Output problem with accented characters

  • Thread starter Luis Paulo Oliveira
  • Start date
L

Luis Paulo Oliveira

------=_NextPart_000_0010_01C3E458.F42E0EE0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Hi,
=20
I don't know what is happening. Imagine this simple program that just =
prints
something to the console:
=20
print "Isto =E9 texto com carateres acentuados: =E1=E3=E7=F5=FA=E9"
=20
If I use irb everything goes ok. But if I save this as a text file, ex:
test.rb and run it through the ruby interpreter it prints garbage in =
place
of the accented caracters. How can I have the correct caracters printed =
?
=20
Using Ruby 1.8.1, mswin32 build, Windows XP english, portuguese =
keyboard.
=20
Thanks

------=_NextPart_000_0010_01C3E458.F42E0EE0--
 
J

Josef 'Jupp' SCHUGT

Hi!

* Luis Paulo Oliveira:
print "Isto é texto com carateres acentuados: áãçõúé"

If I use irb everything goes ok. But if I save this as a text file,
ex: test.rb and run it through the ruby interpreter it prints
garbage in place of the accented caracters. How can I have the
correct caracters printed ?

Sounds familiar even though I have not been using Windows for quite a
long time:

If you see a lowercase beta, lowercase pi, lowercase gamma, lower
part of integral symbol, centered dot an lowercase theta the problem
is that that the console uses Codepage 865 while the GUI uses
codepage 1252.

Find an editor that is capable of saving the file in cp 865 or a
conversion tool or simply used 'edit' to write the program :->

Josef 'Jupp' SCHUGT
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,272
Latest member
MaricruzDu

Latest Threads

Top