Click here to Skip to main content
15,897,371 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I am using classic ASP to get data from a "Text" field type in a table from an SQL 2012, using the native client provider SYSCLI11. When I look at information in the Text field, among the other data, I see this:

<td> </td>


Which looks good.

When I open the webpage and obtain the data after opening the table and getting the record, the data for that field comes through like this:

<td>Â </td>


I checked to make sure there was no special hidden characters in the Text field between the
tags in the database but is just the whitespace.

I was thinking the collation type for the field would need to be changed but it does not seem to help. Does anyone have any insight on this?

Thanks
Posted

1 solution

I am pretty sure it is a code page problem. Make sure to emit html code with the same encoding as your data is stored in the database. Use Response.CodePage[^] and encoding meta tag[^] in conjunction to provide proper output. As I see, you have unicode (utf-8) encoding in your database.
 
Share this answer
 
Comments
onemorecoke 31-May-13 14:16pm    
I added Response.CodePage = 65001 and Response.CharSet = "utf-8" to the asp page but it did not seem to help.
Zoltán Zörgő 31-May-13 14:19pm    
Make sure to have your asp file also saved in utf format. I don't know what editor you use, notepad++ can do the conversion. And set Response.CharSet = "utf-8" too. Are your fields NVARCHAR or VARCHAR? If you have put unicode data in them, they should be NVARCHAR (or NCHAR).
But: don't believe me with the codepage, check data and make sure to be consistent all over the application. Since you are using asp classic and sql2012 there might be a compatibility problem to if you don't use utf-8 all over.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900