UTF char issue

While reading the data from the text file,the special characters has not
been printed as like in the file.

ex:

ë UTF char has changed into δ

Please help me out as soon as possible.....

Regards
Abirami S

···

--
Posted via http://www.ruby-forum.com/.

Please post the code, and if possible, also the text file.
Then we may be able to help you.

Stefan

···

2008/12/8 Abirami Selvam <abirami.janu@gmail.com>:

While reading the data from the text file,the special characters has not
been printed as like in the file.

ex:

ë UTF char has changed into δ

Stefan Lang wrote:

While reading the data from the text file,the special characters has not
been printed as like in the file.

ex:

ë UTF char has changed into δ

Please post the code, and if possible, also the text file.
Then we may be able to help you.

Stefan

MEI-Tsjechië en Slowakije Fonds Acc
Skarbiec FIO Sub Zrównowazony Waga Acc
DnB NOR Øst-Europa Acc

These are the lines available in my txt file.

f= File.open(filename)
f.each do |line|
   puts line
end

Using the above code am reading the file and print the data.

···

2008/12/8 Abirami Selvam <abirami.janu@gmail.com>:

--
Posted via http://www.ruby-forum.com/\.

Hi,

···

In message "Re: UTF char issue" on Tue, 9 Dec 2008 13:57:07 +0900, Abirami Selvam <abirami.janu@gmail.com> writes:

MEI-Tsjechië en Slowakije Fonds Acc
Skarbiec FIO Sub Zrównowazony Waga Acc
DnB NOR Øst-Europa Acc

These are the lines available in my txt file.

f= File.open(filename)
f.each do |line|
  puts line
end

Using the above code am reading the file and print the data.

It doesn't happen on me. I am afraid that it's caused by encoding
mismatch, perhaps either your data or your console do not set to
UTF-8.

              matz.

Yukihiro Matsumoto wrote:

Hi,

>MEI-Tsjechi� en Slowakije Fonds Acc
>Skarbiec FIO Sub Zr�wnowazony Waga Acc
>DnB NOR �st-Europa Acc
>
>These are the lines available in my txt file.
>
>f= File.open(filename)
> f.each do |line|
> puts line
> end
>
>Using the above code am reading the file and print the data.

It doesn't happen on me. I am afraid that it's caused by encoding
mismatch, perhaps either your data or your console do not set to
UTF-8.

              matz.

While running the same code in SCITE editor it is working fine. Am using
ruby 1.8.6 (2007-09-24 patchlevel 111) [i386-mswin32]. For more
information Please find the attachment

Attachments:
http://www.ruby-forum.com/attachment/3043/UTF-Char_issue.doc

···

In message "Re: UTF char issue" > on Tue, 9 Dec 2008 13:57:07 +0900, Abirami Selvam > <abirami.janu@gmail.com> writes:

--
Posted via http://www.ruby-forum.com/\.

Hi,

···

In message "Re: UTF char issue" on Tue, 9 Dec 2008 14:43:15 +0900, Abirami Selvam <abirami.janu@gmail.com> writes:

While running the same code in SCITE editor it is working fine. Am using
ruby 1.8.6 (2007-09-24 patchlevel 111) [i386-mswin32]. For more
information Please find the attachment

I believe your console lacks ability to print UTF-8 characters. Even
simple 'type sample.txt' can cause your "problem". So it's not Ruby's
fault at all.

              matz.