Gidi,
This sounds more like translation than encoding. As you have seen,
there isn't an encoding that will translate a Hebrew character into an Ascii
equivalent.
Since you know the character codes of the Hebrew characters you want to
translate, why not do this?
Assume that the Hebrew characters take up unicode characters 600-699
(this is a guess).
What you would do is create an array of 100 elements. If every unicode
mapping maps to a single character, then you can use a char (you should use
a char if you are going to subsequently string together words with these
character) as the array type. If the characters map to multi-character
strings, then the array should be strings.
As you are cycling through your unicode characters, subtract the value
of the low end of the range (in this case, 600). This is the element in the
array to get the equivalent character/string of, and you can append it to
your return string.
You could also place this in a class that derives from Encoding and then
it would help you in a great number of situations.
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
-
mv*@spam.guard.caspershouse.com
"Gidi" <sh*****@hotmail.com.dontspam> wrote in message
news:14**********************************@microsof t.com...
Hi,
I'm writing a C# win application program, and i need to transfer my hebrew
letters from unicode to ascii, now if i use the ascii encoding it writes
me
??? instead of the hebrew letter i've entered. I know what the Ascii value
of
each letter, so i understood that i can transfer my string to BYTE and
enter
the ascii value by myself. if someone has a better idea, i'll be happy to
hear about it.
how can i know the Unicode value of a charter while the program running? i
want to make subtraction between the unicode value to the difference in
Ascii
so i'll always get the ASCII value.
one more thing, if someone can give me an example how can i convert my
char
value to byte.
thanks,
Gidi.