Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

MySQL Database Charset

Posted on 2009-04-03
10
Medium Priority
?
527 Views
Last Modified: 2012-05-06
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?
0
Comment
Question by:golfDoctor
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 7
  • 3
10 Comments
 
LVL 29

Expert Comment

by:Michael Worsham
ID: 24060176
See if this helps...

Decode and Encode UTF-8
http://www.codetoad.com/asp_utf8.asp
0
 
LVL 16

Author Comment

by:golfDoctor
ID: 24060962
Not sure that's going to handle it.  For example, mdash is stored like this in the mySQL database: â¬
0
 
LVL 29

Expert Comment

by:Michael Worsham
ID: 24061217
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
The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

 
LVL 16

Author Comment

by:golfDoctor
ID: 24061788
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
 
LVL 16

Author Comment

by:golfDoctor
ID: 24061793
When posting to EE, the characters don't render as they show in DB either :)
0
 
LVL 16

Author Comment

by:golfDoctor
ID: 24061816
This is the HTMLEncode that results from the mdash in mySQL.  â€”
0
 
LVL 29

Assisted Solution

by:Michael Worsham
Michael Worsham earned 400 total points
ID: 24061886
0
 
LVL 16

Author Comment

by:golfDoctor
ID: 24061923
Yes, I saw SET NAMES before, but didn't want to screw up the DB.  Maybe I'll give it a shot.
0
 
LVL 16

Author Comment

by:golfDoctor
ID: 24062101
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
 
LVL 16

Accepted Solution

by:
golfDoctor earned 0 total points
ID: 24115677
No solutions, other than my intermediate page.
0

Featured Post

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
By, Vadim Tkachenko. In this article we’ll look at ClickHouse on its one year anniversary.
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…

670 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question