> --- "Ian M. Evans" <[EMAIL PROTECTED]> wrote: > > How do you handle accented words and other problematic > > symbols on your database-driven sites? If you need to > > store one, do you store it as the actual character and > > display it with htmlentities, or do you store it as the > > html entity? > > Most people seem to prefer storing the data in its raw form > and translating it when you want to view it in HTML. This > can be very helpful if you are going to do something else > with the data (other than displaying it in a browser) or if > your formatting requirements are subject to change. > > However, it is ultimately up to you. If data is typically > viewed a few hundred times per single insert, it might be > worth the performance gain for you to format the data > before storing it. This way, when you get the data for > display, you don't have to perform any string functions. > > So, I guess you could say (this is a gross generalization, > but fairly accurate): > > Store data formatted => greater performance > Store data raw => greater flexibility > > Hope that helps.
I agree. And 4.3 has a html_entity_decode() function that you can use to reverse your encode. So, store it in the format that it's going to be viewed in the most, then decode/encode for the exceptions. ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php