FDavidov FDavidov - 7 months ago 25
MySQL Question

Why do MySQL adds a single double quote to strings with semitic languages

I have a multi-language Web application written in JavaScript, which approaches a JAVA servlet which it its turn has access to a MySQL database.

Everything appears to work OK except when the language in use is a Semitic one (Arab, Persian, Hebrew) in which case, miraculously, a double-quite character is added at the beginning (or end, depending how you look at it) of the string.

The servlet prints to the console whenever it receives and there, it all looks OK.

When I look at the database, a double-quote character is being added.

So I am inclined to thing that the issue is between the Servlet and MySQL.

This does not happen with any other character set.

Does anyone have any idea why and how to make it work correctly?

Thanks in advance.


It would appear that your answer is here

and this java one with an example:

String unicode= "?useUnicode=yes&characterEncoding=UTF-8";
con = DriverManager.getConnection(url+db+unicode,"root","");

Check also the MySQL manual page entitled Character Sets and Collations Supported by MySQL.

Feel free to downvote this answer. I am happy to delete it too.