Link to home
Start Free TrialLog in
Avatar of Wisebird
WisebirdFlag for Hungary

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.Unicode.GetString(System.Text.Encoding.GetEncoding(1251).GetBytes(Source));
            textBox2.Text = Target;

but it doesnt work anyway...
Avatar of surajguptha
surajguptha
Flag of United States of America image

cyrillic letters as in cyrilic font?
Avatar of Wisebird

ASKER

yepp
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
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?
Encoding.GetEncoding("iso-8859-1").GetString(Encoding.GetEncoding("iso-8859-5").GetBytes(Source));

thats the answer ;)
Cool. Best of luck :)
ASKER CERTIFIED SOLUTION
Avatar of Computer101
Computer101
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial