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?
Printable View
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?
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.
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.
:(
This is a charset problem.
What does the function mysql_client_encoding return?
What is the Content-type header for your page? Does the charset you are telling the browser to use match the value returned above?PHP Code:echo mysql_client_encoding($db_handle)
Use Page Info (Firefox) or Properties (IE) to check this header if you're not sure.Code:Content-type: text/html; charset=utf8