|
Posted by Rik on 08/20/07 21:33
On Mon, 20 Aug 2007 23:27:34 +0200, Dave Mennenoh =
<dave@blurredistinction.com> wrote:
> Hi all, I have a small site, all in English right now, and the client =
=
> wants
> visitors to be able to select between English, Polish or Russian. I ha=
ve =
> the
> translation text in MS Word docs. My thought was to store the text in =
=
> MySQL
> tables and then pull it out for display based on a session var. Seems =
=
> simple
> enough, I'm just having a little trouble as to how to format the text
> properly.
> Can anyone help - how do I get the text, with all the crazy characters=
, =
> from
> Word into a text field in MySQL, and then out to display on the page? =
=
> Simple
> URLencoding didn't work...
Urlencoding is only for urls, not for content.
- Use the iconv_* function to all in UTF-8 to let PHP behave nicely.
- Set the field (or table, or database) in the database to utf-8, run "S=
ET =
names=3D'UTF8'" once on the database connection prior to evry other quer=
y.
- Output a header (either use the default_charset setting in php.ini or =
=
output your own header()) informing the UA everything is in UTF8.
-- =
Rik Wasmus
[Back to original message]
|