At present my software support logs only in English language but my client need in different languages like Japanese, Korean, Turkish and Arabic etc.
Now instead of changing code from scratch and spending ample amount of time on retesting, what I am thinking is just to convert English language file to say Japanese language and show to user.
I tried using this code but it’s not working for me, it show same output
Say input here is “test input”
public static string ConverToJapaneese(string message)
string outputmessage = string.Empty;
Encoding SourceEncoding = Encoding.GetEncoding("shift-jis");
Encoding TargetEncoding = Encoding.UTF8;
byte UnicodeBytes = TargetEncoding.GetBytes(message);
byte JapaneeseBytes = Encoding.Convert(TargetEncoding, SourceEncoding, UnicodeBytes);
char JapaneseChars = new char[SourceEncoding.GetCharCount(JapaneeseBytes, 0, JapaneeseBytes.Length)];
SourceEncoding.GetChars(JapaneeseBytes, 0, JapaneeseBytes.Length, JapaneseChars, 0);
string JapaneseString = new string(JapaneseChars);
outputmessage = System.Text.Encoding.GetEncoding(932).GetString(JapaneeseBytes);
I learn its from this link
I will get solution if I can convert a file from one language to another.
Anyone can provide me better solution and throw some light on different encodings in different languages.
Code block added, "Ignore HTML..." option disabled, link linkified - OriginalGriff[/edit]