I am using a third party OCR Library to convert an Image containing Japanese characters to a text file. The Text file created looks alright when I open it by double clicking but when I load it in TextBox using the code below it becomes strange.
this.textBox1.Text = File.ReadAllText(Outpath);
ReadAllText method can take the encoding as a parameter.
for a japanese file you should probably use:
this.textBox1.Text = File.ReadAllText(Outpath, Encoding.Unicode);
if your file is encoded in UTF8:
this.textBox1.Text = File.ReadAllText(Outpath, Encoding.UTF8);
Hope this helps,
Sylvain
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.