[thelist] UTF-8/FormMail/PHP headaches

Peter Johansson peter at johansson.org
Thu May 23 01:11:01 CDT 2002


On Wed, 22 May 2002, Howard The Duck wrote:

> Well i'd do a regex check if any of your languages special chars are in
> the posted text - if they are it's ISO-8859-1 else it's UTF-8
> a crazy hack but it might work

Thanks for the suggestions Howard, that could work. Problem is I'd have to
check for _all_ special characters in the posted text since some forms are
used for not only swedish but also other countries with special chars.

> adding an extra variable to check for is probably faster - you mentioned
> it already. Another idea is to copy your formmail script, rename it
> mailutf8.php, modify it as u need and use it on your new forms within
> the utf-8 encoded pages. Or you can run a script through all your
> webfiles that converts the files from ISO to utf-8 and change the
> servers settings to serve utf-8 only. for unix systems the following 2
> lines should work (example):

I guess we could change the server settings to server UTF-8 only, but is
it reliable? Will the pages show up correctly in whatever browser is used
on the client? That would affect thousands of pages on a pretty high
traffic, high profile site.

As for now I think the separate script thing is the way to go, I'm not at
all happy with it, but it seems to be the only reliable way of doing it.
The simple and elegant solution just doesn't seem to exist in this case :(

Thanks for helping out,
Peter




More information about the thelist mailing list