Welcome to WebmasterWorld Guest from 54.145.208.64

Forum Moderators: incrediBILL

Message Too Old, No Replies

charset issue

   
8:22 am on Jan 28, 2011 (gmt 0)

5+ Year Member



Hi,

I have a site using spanish language. The site was basically built using a separate language pack and smarty template engine.

The site works fine for English and Spanish too.
The charset is set to UTF-8.

It accepts the ascents like but the only problem I am facing is when this comes from the database in a SELECT drop down menu, it shows a ? mark in that.

When I try to change the charset to iso-8859-1, it fixes this issue in the drop down, but messes up everywhere the same coming from the language pack variables.

Please help.

Thanks
12:26 pm on Jan 28, 2011 (gmt 0)

WebmasterWorld Senior Member kaled is a WebmasterWorld Top Contributor of All Time 10+ Year Member



Firstly, if you haven't done so already, you must check that the database is at fault by placing statically into a <select>.

Thereafter, if it is the database, either the data is stored incorrectly, or it is being extracted incorrectly - those are your only options.

If the database stores data in unicode/utf-8 format then it is likely that data is being stored incorrectly.
OR
If the database stores data in 8bit/Ansi format, that data will need to be converted to unicode/utf-8 format if it is going to be used on a unicode/utf-8 page.

In other words explicit conversion to unicode/utf-8 may be required either when storing data or when retrieving it.

Kaled.
12:41 pm on Jan 28, 2011 (gmt 0)

5+ Year Member



how do I check those in mysql?
4:36 pm on Jan 28, 2011 (gmt 0)

WebmasterWorld Senior Member kaled is a WebmasterWorld Top Contributor of All Time 10+ Year Member



I don't work with databases so you'll have to figure out that part yourself unless someone else can help.

You may find this useful, otherwise try searching for MySQL UTF8.
[dev.mysql.com...]

Kaled.
11:53 pm on Jan 31, 2011 (gmt 0)

10+ Year Member



I had a similar problem with a .js file that I was trying to display. I solved it with:

<script ... charset="ISO-8859-1"></script>