Wisebird
asked on
Converting text from Cyrillic to Western European (iso)
Hi all,
my question is how can I encode a string from textbox1 (cyrillic letters, as far as i understand - its unicode) to Western European (ISO) encoding?
what i got so far is
string Source = textBox1.Text;
string Target = System.Text.Encoding.Unico de.GetStri ng(System. Text.Encod ing.GetEnc oding(1251 ).GetBytes (Source));
textBox2.Text = Target;
but it doesnt work anyway...
my question is how can I encode a string from textbox1 (cyrillic letters, as far as i understand - its unicode) to Western European (ISO) encoding?
what i got so far is
string Source = textBox1.Text;
string Target = System.Text.Encoding.Unico
textBox2.Text = Target;
but it doesnt work anyway...
cyrillic letters as in cyrilic font?
ASKER
yepp
0 1 2 3 etc
0 1 2 3 etc
I hope the text box you are using is a RichText box?? In that case just assign the text to the textbox and then set the font of the text box to Western European iso font
ASKER
hi, thanx for the tip and sorry for long delay - been ill.
anyways, yes, i use the richtextbox, but when in the properties i set the "script" (it is said that way) to western, and rechek it right after - its back to cyrillic.
what can be wrong?
anyways, yes, i use the richtextbox, but when in the properties i set the "script" (it is said that way) to western, and rechek it right after - its back to cyrillic.
what can be wrong?
ASKER
Encoding.GetEncoding("iso- 8859-1").G etString(E ncoding.Ge tEncoding( "iso-8859- 5").GetByt es(Source) );
thats the answer ;)
thats the answer ;)
Cool. Best of luck :)
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.