• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Unicode with MySQL

 
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 ?
 
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
 
There will be plenty of time to discuss your objections when and if you return. The cargo is this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic