Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Issue with characrter encoding  RSS feed

sreeni san
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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".
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!