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

python - how we can use ajax() in views.py in django? -

matlab - Using loops to get multiple values into a cell -

python - Sequence Pattern recognition with Pybrain -