WmZilla - Webmaster and Marketplace

The Next Generation Webmaster and Trade Forum

MySQL Foreign Character Issue

Spark

New member

0

0%

Status

Offline

Posts

46

Likes

0

Rep

0

Bits

240

3

Months of Service

0%
I've been struggling for hours but couldn't solve the problem. I want to store data in a table with multiple language characters (Turkish, Arabic, Russian, etc.). However, the data I save using ASP is being recorded in the database as ????? unknown characters. When I manually enter the data, the characters appear correctly. Could the issue be with ASP? I've tried setting the database's character sets (db, table, column) to utf_general_ci and utf_unicode_ci, but unfortunately, the problem persists. The HTML side also has utf-8 character set defined. ASP files are set as utf-8 without BOM. I've searched tirelessly on Google with no results. I suspect ASP more in this situation, but does anyone have any suggestions? Here are my ASP connection codes:
```asp
Response.ContentType = "text/html"
Response.AddHeader "Content-Type", "text/html;charset=UTF-8"
Response.CodePage = 65001
Response.CharSet = "UTF-8"

mysql_server = "DBHOST"
mysql_user = "DBUSER"
mysql_pass = "DBPASSWORD"
mysql_db = "DBNAME"

Set connection = Server.CreateObject("ADODB.Connection")
Connection.Open = "driver={MySQL ODBC 3.51 Driver}; server="&mysql_server&"; port=3306; UID="&mysql_user&"; pwd="&mysql_pass&"; db="&mysql_db&""
Connection.Execute "SET NAMES 'utf8'"
Connection.Execute "SET CHARACTER SET utf8"
Connection.Execute "SET COLLATION_CONNECTION = 'utf8_unicode_ci'"
```
 

249

6,622

6,642

Top