c# - Japanese characters Encoding Issues -


I am using a third party OCR library in which an image file has been converted to a text file in Japanese characters . When I open it by double clicking, the text file looks ok, but when I load it in the text box using code below it becomes strange

  this. Textbox1.Text = file. Read all text (outpath);    

Read Now can take encoding as a text parameter.

For a Japanese file you might use:

  this.textBox1.Text = File.ReadAllText (Outpath, Encoding.Unicode);   

If your file is encoded in UTF 8:

  this.textbox1.Text = file.ReadAllText (Outpath, Encoding.UTF8);   

Hope this helps,

Sylvain

Comments

Popular posts from this blog

c - Mpirun hangs when mpi send and recieve is put in a loop -

python - Apply coupon to a customer's subscription based on non-stripe related actions on the site -

java - Unable to get JDBC connection in Spring application to MySQL -