Home > Archive > PHP Language > August 2007 > Displaying alternate language
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Displaying alternate language
|
|
| Dave Mennenoh 2007-08-20, 7:00 pm |
| 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 have 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...
--
Dave -
Head Developer
http://www.blurredistinction.com
Adobe Community Expert
http://www.adobe.com/communities/experts/
| |
|
| 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
|
|
|
|
|