I have created a page which is supposed to pull some information from a mysql database and display them. Another page is supposed to save the data to the database.

The problem is, that I am not even able to get the data in Persian or Arabic displayed correctly, instead I receive ? for each character.

I have the following codes in my asp:

@CODEPAGE=65001 LANGUAGE = "VBScript"

Response.CodePage = 65001
Response.Charset = "UTF-8"
Response.ContentType = "text/html"  
Response.AddHeader "Content-Type", "text/html;charset=UTF-8"

The html output file has the proper meta tag also, at least I believe.

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

The database fields have the UTF-8 characterset.

The output is ???. I tried different other settings I had found after googling for a while, but all of them didn't help. I hope your advices do, so that I can get this project up and running?

Member Avatar for LastMitch

The output is ???. I tried different other settings I had found after googling for a while, but all of them didn't help. I hope your advices do, so that I can get this project up and running?

Instead of

Response.Charset = "UTF-8" 

try this:

Response.Charset = "windows-1256"

So the code should look like this:

@CODEPAGE=65001 LANGUAGE = "VBScript"
Response.CodePage = 65001
Response.Charset = "windows-1256"
Response.ContentType = "text/html"
Response.AddHeader "Content-Type", "text/html;charset=windows-1256"

<meta http-equiv="Content-Type" content="text/html; charset=windows-1256" />

This is should work. You can read this here:

http://en.wikipedia.org/wiki/Windows-1256

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.