0

Here is the thing: I need to display japanese character in listview in a SQL operated database manager I am currently building for a friendly company. Tried to google, but all answers led me to nothing really. Instead of displaying characters it just does "????". Have a look:

View

but I am loading a properly displayed .csv file from a machine that has a japanese installed on it. Also its been saved as utf8:

csv

Font I am using is Meiryo UI. Tried Tahoma and the same thing is happening. Loading is being done including encoding:

3

And finally here's the code responsible for stuffing the data into a listview:

4

I would really appreciate if someone could help me. Thanks!

iehrlich
  • 3,572
  • 4
  • 34
  • 43
Tatsurou
  • 111
  • 1
  • 9

2 Answers2

1

You are using a streamreader to open the file, but you are not using that same streamreader to read the data. Instead you are instructing SQL server to open it using the BULK INSERT command. Prior to Sql 2012 SP2, there was no support for UTF-8 in BULK INSERT.

If you are using Sql 2012 SP2 or above, you might consider Tom-K answer here:

Failing that, you must either convert the file to UTF-16 before doing the bulk insert, or use another method.

Ben
  • 34,935
  • 6
  • 74
  • 113
  • Both method failed as loading displays question marks or gibberish. I will try to change SQL server to a newer version and see what happens – Tatsurou Jul 03 '17 at 16:55
0

I managed to solve this thing. While using SQL Server 2014 I simply forgot to change the collation encoding in database settings. It was set on Latin instead of Japanese-Unicode BIN. Thanks to Ben for pointing me right direction.

Fixed

Tatsurou
  • 111
  • 1
  • 9