tags:

views:

493

answers:

1
+3  Q: 

C# Reading Hebrew?

Hi all,

My program reads a CSV file that contains hebrew text, it then displays the values in a form but the text is unredable. What am I doing wrong?

Thanks James

+2  A: 

Possible options for what you're doing wrong:

  • Reading the file with the wrong encoding
  • Using a font that doesn't support Hebrew
  • Using a control that doesn't support right-to-left

How are you reading the file? If you look at the data in the debugger, does it seem correct? Do you know what encoding the file is in to start with?

See my Debugging Unicode Problems for some suggestions - although they won't help with any right-to-left issues. (I'm afraid I don't know much about bidi displays.)

Jon Skeet
I would start with checking the encoding, then the font, and lastly the bidi issue. Wrong right-to-left configuration at least shows you Hebrew characters.
Yuval F
@Yuval: Yup. Will reorder the points to make this suggestion implicit.
Jon Skeet
Thanks Jon, after playing in VS for awhile with no luck I tried to open the file in notepad and I can't read the file correctly with notepad even if I select UTF8 encoding. I've installed the hebrew support for XP but I'm still struggling to read it. I think I need to be able to read the file using another program first before I start work on mine. Thanks
Do you know which encoding it's *meant* to be encoded in?
Jon Skeet
I'm afraid not, I've tried to find out but the person who gave me this doesn't know. I'm told the text is Hebrew. I could do with reading up more about this as I've been told i may need to support other double-byte languages????
Just knowing the language doesn't tell you what encoding it's in, unfortunately. You really need to know that before you can make more progress.
Jon Skeet
With what encoding did you try to read the file? try either utf-8 or iso-8859-8, they're the most common for hebrew text.
Miki Watts