Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Text sometimes garbled. Using wrong character set?

Status
Not open for further replies.

majjk

Technical User
Dec 9, 2004
7
GB
Hi,
I’ve been using mysql databases for some time. However, I haven’t really bothered with details such as character sets (which I hardly know anything about anyway...). Now I’d like to make sure things are done properly... This is the story so far;

I’ve got a website where most text is pulled from a mysql database. Things look fine when specifying

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

in my webpages. Also, adding data to the database using a form on one of my webpages works fine, as the text displays correctly on the pages after being pulled from that same database. However, not everything is perfect…

If I add the characters "åäö" to the database via phpmyadmin, then it is displayed as "???" on the webpage. If I add the characters åäö to the database via my own form on one of my webpages, then it looks fine on the website, but it is displayed as "åäÃ" when viewing it in phpmyadmin.

Clearly I need to change something, but what? The only info I find in phpmyadmin regarding character sets is that COLLATION is set to utf8_unicode_ci for my table and that all the text fields in my table has COLLATION set to latin1_swedish_ci. Should both table and fields be set to the same? Are there some other changes to make? Do I need to do any nasty conversions?

Please let me know if you need any further info...
 
My problem looks to be the same. My local copy of MySQL (for development) correctly renders the 'registered' symbol &reg;. But I found the version uploaded to my ISP using phpMyAdmin displays a question mark. I noticed this on the PHP-->HTML output, then discovered it is the same when viewing the table through phpMyAdmin. So I'm poking around for character set settings and not succeeding. Most settings are already Latin 1 or utf-8. How do I fix this?!

[purple]If we knew what it was we were doing, it would not be called
research [blue]database development[/blue], would it? [tab]-- Albert Einstein[/purple]​
 
Whoa. Majjk, great news sort of. My records now show the 'Registered' symbol correctly .... but I don't know what I did. I have been twiddling with font selection on the HTML, that's my best guess at the moment. If I can see what made the difference, I will post.

[purple]If we knew what it was we were doing, it would not be called
research [blue]database development[/blue], would it? [tab]-- Albert Einstein[/purple]​
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top