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

2008/12/8 Abirami S. [email protected]:

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

Stefan L. wrote:

2008/12/8 Abirami S. [email protected]:

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.

Hi,

In message “Re: UTF char issue”
on Tue, 9 Dec 2008 13:57:07 +0900, Abirami S.
[email protected] 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 M. wrote:

Hi,

In message “Re: UTF char issue”
on Tue, 9 Dec 2008 13:57:07 +0900, Abirami S.
[email protected] 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.

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

Hi,

In message “Re: UTF char issue”
on Tue, 9 Dec 2008 14:43:15 +0900, Abirami S.
[email protected] 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.