Getting question marks when inserting Hebrew characters into a MySQL table
You need to tell the JDBC driver to use UTF-8 encoding while decoding the characters representing the SQL query to bytes. You can do that by adding useUnicode=yes
and characterEncoding=UTF-8
query parameters to the JDBC connection URL.
jdbc:mysql://localhost:3306/db_name?useUnicode=yes&characterEncoding=UTF-8
It will otherwise use the operating system platform default charset. The MySQL JDBC driver is itself well aware about the encoding used in both the client side (where the JDBC code runs) and the server side (where the DB table is). Any character which is not covered by the charset used by the DB table will be replaced by a question mark.
See also:
- Spring Encoding with CharacterEncodingFilter in web.xml
Database is showing hebrew, but in php the hebrew data is showing as question marks
Check your character encoding is consistently UTF-8 everywhere.
- Check the DB is utf-8
- Check the table is utf-8
- check the column is utf-8
- check the html meta tag charset is utf-8
- check in your IDE or text editor that the PHP file is utf-8.
from c# server to mysql DB - hebrew question marks
After changing both the collation and the web.config as described, the only thing that I didn't change was the procedures in the DB.
So, after changing from this:
pCategoryDescH varchar(300)
to this:
pCategoryDescH nvarchar(300)
finally it worked.
The solution was found here
Related Topics
Post and Get at the Same Time in PHP
Setting Value of a HTML Form Textarea
Is There a PHP Sandbox, Something Like Jsfiddle Is to Js
PHP Pdo VS Normal MySQL_Connect
Dynamic Paypal Button Encryption
How to Get the Os on Which PHP Is Running
Understanding Nested PHP Ternary Operator
Using PHP Variables Inside HTML Tags
How to Read Only 5 Last Line of the Text File in PHP
PHP Memcached Fatal Error: Class 'Memcache' Not Found
Sqlstate[Hy000] [1045] Access Denied for User 'Username'@'Localhost' Using Cakephp
Best Practices to Test Protected Methods with PHPunit