aspose file tools*
The moose likes Java in General and the fly likes Need help with using Greek letters read in from file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Need help with using Greek letters read in from file" Watch "Need help with using Greek letters read in from file" New topic
Author

Need help with using Greek letters read in from file

Lavanya Halliwell
Ranch Hand

Joined: Apr 09, 2010
Posts: 57
Hi all, if any of y'all have suggestions, let me know cause i'm stuck here.

I have a greek word "Σεπτέμβριος" (= "September" fyi), my goal is to use each character in the string to match it to the the first character in a line from the file (which will be stored in an array)

example: i hit the "Σ" in the string, after reading file I iterate through the array and find the line that matches, in this case "Σ=\u03a3".

I then use the string part from the array (example "\u03a3") to create the encoded version of the greek word for "September".

once I make this, I write it to a file and I will see "Σεπτέμβριος" in the file.

I have already proved that if I write "\u03a3\u03b5\u03c0\u03c4\u03ad\u03bc\u03b2\u03c1\u03b9\u03bf\u03c2", I will get the output I need.

the issue: it has a problem comparing the greek letters read from the file. I can write UTF-8 form, how can I read in it? how can I successful read a greek character?








Lavanya
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14688
    
  16

I'm not even thinking of what the problem could be now I'd just like to point out that you are using "UTF-8" for writing, and "UTF8" for reading. This does not match. Both should be "UTF-8".


[My Blog]
All roads lead to JavaRanch
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Need help with using Greek letters read in from file