From: Hal Fulton Date: 2012-09-26T06:09:48+09:00 Subject: Encoding issues... --20cf30207fc4302af404ca8d20d7 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable I am playing more with encodings and having some problems. I pasted the text below from web pages... when I view the source in a browser as UTF-8, it appears correct. But running it gives an error. I'm sure I'm doing something dumb here, but I can't see it. Note that the "encoding" comment is on line 2 of the source... Thanks, Hal # encoding: UTF-8 text =3D <<-EOF Ein Schauer fa=DFt mich, Thr=E4ne folgt den Thr=E4nen Das strenge Herz es f=FChlt sich mild und weich... Le coeur a ses raisons, que la raison ne conna=EEt point. O gene umana, per volar s=F9 nata, perch=E9 a poco vento cos=EC cadi? EOF puts text bash-3.2$ ruby -v ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-darwin11.4.0] bash-3.2$ bash-3.2$ ruby try.rb try.rb:6: invalid multibyte char (US-ASCII) try.rb:4: syntax error, unexpected $end, expecting tSTRING_CONTENT or tSTRING_DBEG or tSTRING_DVAR or tSTRING_END bash-3.2$ --20cf30207fc4302af404ca8d20d7 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable I am playing more with encodings and having some problems.

I pasted the text below from web pages... when I view the source in=A0
a browser as UTF-8, it appears correct.

But running it gives an error.

I'm sure I'= m doing something dumb here, but I can't see it.

Note that the "encoding" comment is on line 2 of the source...=

Thanks,
Hal

# encoding: UTF-8

text =3D <<-EO= F

Ein Schauer fa=DFt mich, Thr=E4ne folgt den Thr= =E4nen
Das strenge Herz es f=FChlt sich mild und weich...

Le coeur a ses raisons, que la raison ne conna=EEt point.
<= br>
O gene umana, per volar s=F9 nata,
perch=E9 a poco = vento cos=EC cadi?
EOF

puts text
bash-3.2$ ruby -v
ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-darwin11.4.0]
bash-3.2$=A0
bash-3.2$ ruby try.rb=A0
try.rb:6: = invalid multibyte char (US-ASCII)
try.rb:4: syntax error, unexpected $end, expecting tSTRING_CONTENT or = tSTRING_DBEG or tSTRING_DVAR or tSTRING_END
bash-3.2$=A0
--20cf30207fc4302af404ca8d20d7--