Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Codepage considerations in multilingual PHP application

0 views
Skip to first unread message

Iwan Davies

unread,
Apr 14, 2003, 12:25:58 PM4/14/03
to
I'm just about to embark on designing a website for a friend who runs a
mailorder business. The website is going to be built using PHP and a MySQL
database, and will be localized into Hungarian, as well as the native
English version. As I will need to store some Hungarian in the database, I
was wondering what codepage restrictions I will face? Users will be able to
update and insert data in the database, so do I have to detect the codepage
being used by their browser when their data is submitted? Presumably this
means dealing with Windows 1250, CP1250, Unicode UTF8 and UTF16?

It's a long time since I had to do anything like this, and I'm not sure
where to start looking for info - anyone have any good resources for
developing multilingual databases using MySQL and PHP?

Cheers

Iwan
--

Bertilo Wennergren

unread,
Apr 16, 2003, 7:14:44 AM4/16/03
to
Iwan Davies:

> so do I have to detect the
> codepage being used by their browser when their data is submitted?

Yes. Unfortunately that is not so easy. No such info is being transmitted
along with the data.

> Presumably this means dealing with Windows 1250, CP1250, Unicode UTF8 and
> UTF16?

Probably.

If the data is being submitted from an HTML form, most of the time the
encoding will be the one you're using in that HTML page (you need to
explicitly set the encoding in the HTTP headers, or with a "meta" element).
But if the browsers is old (and misbehaves), or if the user intentionally
switches the encoding, that will not be the case. (There can also be weird
problems if the users enter characters that are not supported in the active
encoding...)

You'll just have to look at the data and try to guess what encoding it is
in. To do that you'll have to know quite a bit about how those encodings
work.

It's a mess, I know...

--
Bertil Wennergren <bert...@gmx.net> <http://www.bertilow.com>

0 new messages