Could you please be so kind and help me in the following situation:
I am coding a simple text editor program whichwould convert an UTF-8 text file from one unicode range to another (for example, Devanagari into Latin). I have built a table of character correspondences but I am not sure which method to use on this table. So, the problem is to read the text opened in a child window, change it in accordance with my encoding table and open the result in the second MDI window.
I will be thankful for any advice.
Text encoding
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.
Aaron18 pointsPosted Jul 8, 2009, 1:26 PM EDT
I would use a "Switch" statement. Heres a example,
string Encode, encoder; //Put what your gunna say here,well give output according to input Console.Write("PUT INPUT HERE: "); Encode = Console.ReadLine(); switch (Encode) { //Input,"a - English to spanish" case "a - English to spanish": encoder = "La"; break; default: encoder = "What? I couldnt encode that!"; break; } Console.WriteLine(); Console.WriteLine(encoder); Console.WriteLine(); Console.WriteLine("Press [ENTER] to Exit"); Console.ReadLine();This may not be what you want,and would be loads harder,because you would have to have a Switch for every single word like: a - English to spanish
a - English toCzechBut,Hopefully this helps a bit!
(sorry if you were not looking for console)
Stig6 pointsPosted Jul 9, 2009, 3:39 PM EDT
u1234 u2345
u3456 u4567, etc.
Is there any way to use these tables in a C# realisation? I mean, do I have to create a separate class for every table or the Switch case is the best way to treat them?