0

I'm running Squirrel-SQL on Ubuntu.

I cannot write chinese characters on Squirrel, but I can write them in another text editor and copy+paste into squirrel. However, when I run the update and select the data I just inserted, the characters I write show up as question marks.

When I insert the data from a web interface, or when I right click on results and choose "make editable", I can paste in the data which will show up fine when I select again.

This tells me that the database saves the characters fine. Squirrel is capable of displaying the characters fine. The problem seems to be in the sql text editor.

Anyone have this problem before?

Nakilon
  • 34,866
  • 14
  • 107
  • 142
Corey
  • 1,133
  • 4
  • 17
  • 30

1 Answers1

1

I finally found the answer! Looks like hibernate was doing some extra work for me (via web interface or squirrel's "make editable" option on results) that I wasn't aware was necessary. Looks like the problem was actually a syntactical mistake for Microsoft SQL Server. I needed to prepend the letter 'N' right before the characters I wish to insert.

For example:

update title_product set synopsis = N'我很高兴 test' where title_product_id = 26

This converts chinese and english characters correctly. Yay.

Although I still cannot write chinese characters directly into Squirrel, I have to copy+paste from another editor.

Corey
  • 1,133
  • 4
  • 17
  • 30
  • This one adding N worked for me. Thanks for posting the answer.`update title_product set synopsis = N'我很高兴 test' where title_product_id = 26` – reflexdemon Jan 04 '18 at 21:16