Jump to content

utf8 encoding php / mysql / html


rbrunold

Recommended Posts

Hello together !

 

I work on a application that should allow easy task automation from a central station for many different distributed systems. Therefor I create a web frontend based on php and a mysql in the background to do the administration tasks. I try to use some javascript / ajax functions as well to make it easy useable.

 

Here comes the question:

 

I created a input form where any kind of text or code can be entered. I send the content with ajax  (encodeURIComponent encoded) in the POST part of a http request to a server side php script which stores it to the mysql which operates in utf-8 mode. I do no further encodings in php just write it to the database. Running some mysql selects shows me that everything is stored correctly in the db.

 

When I use a php script to read contents from the mysql and show it in a table some characters are incorrect. I was searching a lot at google but I am confused know on how to decode this in php to show it correctly in the table. As far as I know (or think to know) php does not operate in utf-8 mode and that is the reason for that problem. Urldecode does not work because it also does not operate in utf-8 mode.

 

Can somebody please point me on how I can do this ?

 

Thanks a lot,

Rainer

 

 

Link to comment
https://forums.phpfreaks.com/topic/92162-utf8-encoding-php-mysql-html/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.