PDA

Click to See Complete Forum and Search --> : Text output problem (�)


Teckniel
Apr 25th, 2010, 04:47 PM
Hello.

When i grab text out of my database and do a output trough smarty or print_r($content) i get these characters: �


the characters i use in the content are: ë " ä

My question is how can i solve this problem?

menre
Apr 26th, 2010, 08:39 AM
I entered the following characters: 'ë', 'ö', 'õä' and 'ü' inside a table in MySQL database. When I printed it out with echo, and print_r everything displayed correctly without that symbol you are getting. In my database table, I set Collation as latin1_swedish_ci. I suggest you try this or preview your work in another computer to see how it displays.

There might be other solutions.

Teckniel
Apr 26th, 2010, 02:06 PM
the problem is in the database everything corrent.

When i use a debugger and debug the var then everything is also correct.
only when i print the var i have the problem.

if i but a ë on the html page then its also correctly displayed.

:(

penagate
Apr 26th, 2010, 07:59 PM
This is a charset problem.

What does the function mysql_client_encoding return?
echo mysql_client_encoding($db_handle)

What is the Content-type header for your page? Does the charset you are telling the browser to use match the value returned above?
Content-type: text/html; charset=utf8

Use Page Info (Firefox) or Properties (IE) to check this header if you're not sure.