MySQL Database Charset

I have a mysql database and the data is stored as UTF-8.  This works fine for the primary site using it (blog), but I'm also make remote calls to the database from ASP website.  When doing this, I get bad characters back from the database.

For example, curly apostrophes and mdashes are stored in mysql as UTF-8 unicode, but when calling the data remotely, I get back garbled characters when doing response.write()

I have changed the response.charset to UTF-8 as well as ISO ... but neither works.

Any ideas?
LVL 16
golfDoctorAsked:
Who is Participating?
 
golfDoctorAuthor Commented:
No solutions, other than my intermediate page.
0
 
Michael WorshamInfrastructure / Solutions ArchitectCommented:
See if this helps...

Decode and Encode UTF-8
http://www.codetoad.com/asp_utf8.asp
0
 
golfDoctorAuthor Commented:
Not sure that's going to handle it.  For example, mdash is stored like this in the mySQL database: â¬
0
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
Michael WorshamInfrastructure / Solutions ArchitectCommented:
I am not an ASP programmer, but your ASP environment is going to have to encode and decode the UTF-8 character set when sending and retrieving from the MySQL database.
0
 
golfDoctorAuthor Commented:
Maybe this is clearer example.  What I said prior was a bit off.  I can read the database from mySQL fine, and it does response.write OK.  However, I'm taking that data out of mySQL and storing in SQL Server.  The data then is stored in SQL Server, and viewing in SQL Server it shows â¬.
â¬

Open in new window

0
 
golfDoctorAuthor Commented:
When posting to EE, the characters don't render as they show in DB either :)
0
 
golfDoctorAuthor Commented:
This is the HTMLEncode that results from the mdash in mySQL.  â€”
0
 
Michael WorshamInfrastructure / Solutions ArchitectCommented:
0
 
golfDoctorAuthor Commented:
Yes, I saw SET NAMES before, but didn't want to screw up the DB.  Maybe I'll give it a shot.
0
 
golfDoctorAuthor Commented:
I don't feel like messing with SET NAME and possibly screwing up the database.  

I fixed my issue though.  The problem was moving data directly from mySQL to SQL Server.   I made an intermediate page to response.write all the necessary data to the page, which does display the correct data, and then scraped that with XMLHTTP to add it to the SQL Server database.

A bit crude, but it works.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.