genu Posted May 20, 2009 Share Posted May 20, 2009 Hey, I'm working on an application that allows users to submit content, but i'm having a hard time understanding how exactly the submitted information is encoded. The content is in another language I know that I have to utilize utf-8 in order to render the special characters correctly. How do I make sure that the characters inputed by the users are utf-8 compliant though? I've noticed that in windows vista, I have two options for the language which I've selected: "legacy" and "standard", and they (although output the same character), the Hex values for them are not ideantical. How is this typically done, so that all user submitted content are subject to the same encoding. Do I need to, perhaps, have buttons to insert special character's html entities via javascript? When storing the submitted data (assuming it was typed with utf-8 characters), do store them in the mysql db as is? or do store their html entity equivalent? Quote Link to comment https://forums.phpfreaks.com/topic/158866-utf-8-assistance/ Share on other sites More sharing options...
JonnoTheDev Posted May 20, 2009 Share Posted May 20, 2009 By storing the HTML entity you are guaranteed that the output will be correct. There are some mbstring functions that allow you to check encoding. http://uk.php.net/manual/en/function.mb-check-encoding.php Quote Link to comment https://forums.phpfreaks.com/topic/158866-utf-8-assistance/#findComment-837949 Share on other sites More sharing options...
genu Posted May 20, 2009 Author Share Posted May 20, 2009 if the content is to be downloaded, however, do I need to convert the entities? Quote Link to comment https://forums.phpfreaks.com/topic/158866-utf-8-assistance/#findComment-838038 Share on other sites More sharing options...
JonnoTheDev Posted May 20, 2009 Share Posted May 20, 2009 If it's just text yes, not if HTML and the entities exist already Quote Link to comment https://forums.phpfreaks.com/topic/158866-utf-8-assistance/#findComment-838055 Share on other sites More sharing options...
genu Posted May 21, 2009 Author Share Posted May 21, 2009 ok thx Quote Link to comment https://forums.phpfreaks.com/topic/158866-utf-8-assistance/#findComment-838678 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.