UTF char issue

A

Abirami Selvam

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
 
S

Stefan Lang

MjAwOC8xMi84IEFiaXJhbWkgU2VsdmFtIDxhYmlyYW1pLmphbnVAZ21haWwuY29tPjoKPiBXaGls
ZSByZWFkaW5nIHRoZSBkYXRhIGZyb20gdGhlIHRleHQgZmlsZSx0aGUgc3BlY2lhbCBjaGFyYWN0
ZXJzIGhhcyBub3QKPiBiZWVuIHByaW50ZWQgYXMgbGlrZSBpbiB0aGUgZmlsZS4KPgo+IGV4Ogo+
Cj4gw6sgVVRGIGNoYXIgaGFzIGNoYW5nZWQgaW50byDOtAoKUGxlYXNlIHBvc3QgdGhlIGNvZGUs
IGFuZCBpZiBwb3NzaWJsZSwgYWxzbyB0aGUgdGV4dCBmaWxlLgpUaGVuIHdlIG1heSBiZSBhYmxl
IHRvIGhlbHAgeW91LgoKU3RlZmFuCg==
 
A

Abirami Selvam

Stefan said:
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.
 
A

Abirami Selvam

Yukihiro said:
Hi,

In message "Re: UTF char issue"
on Tue, 9 Dec 2008 13:57:07 +0900, Abirami Selvam

|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
 

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
474,184
Messages
2,570,978
Members
47,578
Latest member
LC_06

Latest Threads

Top