This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Unicode with MySQL  RSS feed

 
Vu Pham
Ranch Hand
Posts: 100
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all ,
I have some problems with unicode . I'm using MySQL 4.1 , JDK 5.0 . With the same script to create database , same code to insert data into database , but in my home , when I inserted data into database , it inserted like : Nguyễn Văn , in another computer in my friend's home , it inserted like : Nguy��?n V�?n . I cant understand . Do you know this problems ?
 
Ta Ri Ki Sun
Ranch Hand
Posts: 442
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Anh Vu:
Hi all ,
I have some problems with unicode . I'm using MySQL 4.1 , JDK 5.0 . With the same script to create database , same code to insert data into database , but in my home , when I inserted data into database , it inserted like : Nguyễn Văn , in another computer in my friend's home , it inserted like : Nguy��?n V�?n . I cant understand . Do you know this problems ?


I know you said that it inserted those values but start at the beginning where the data is read from the file or manipulated as String objects.
The operating system's default charset is used unless you specify one, ie new String(someByteArray, "ISO-8859-1") or someString.getBytes("ISO-8859-1")

I found this article very helpful
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!