This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Tomcat and the fly likes Issue with characrter encoding Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Issue with characrter encoding " Watch "Issue with characrter encoding " New topic
Author

Issue with characrter encoding

sreeni san
Ranch Hand

Joined: Aug 14, 2001
Posts: 39
I have flex as my front end which sends the encoded values in the hex format.

For example if I enter k�t in the name field, the UTF-8 for "�" in hex is "c3a1" the flex client posts the data as "name=k%C3%A1t" (I got this info from the Live HTTP headers in my MF browser and verified for the hex values in few sites).

The "name" value is then stored in a table in the MySQL database.

When I query the database using the following query
"select hex(name ), name from customer where id=100;", the query returns me the following value for name.

+---------------------
hex(name) | name |
+-------------+-------+
6BC383C2A174 | k�t |
+------+--------------+-

You can see that though the correct value is "6BC3A174", "83C2" is getting appended in the value corrupting the data before it reaches the buslogic code.

I tried giving System.out.println(name) but this did not help me. I hard coded the value(k�t) for name in my java code and inserted the same, the value seems to be getting stored properly and hence arrived at the above conclusion.

Note: The customer table i am referring to has Character Set "UTF-8 Unicode" and Collation "utf8_general_ci".
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Issue with characrter encoding
 
Similar Threads
Writing Hex Values to a file
MySQL and reading non-English characters in UTF-8
UTF-8 and MS Access
table not mapped error when compiling entity bean
dealing with non ascii characters