Re: [PHP] languages and PHP



David Christopher Zentgraf wrote:

Your biggest problem will be if you accept any kind of user input
which could be in any kind of language.
Depending on your server configuration you'll probably have some
serious cleaning and filtering to do.
I often have to employ this line for example:
foreach (array_keys($_POST) as $key) $clean[$key] =
mb_convert_encoding($_POST[$key], "UTF-8");

Trying to make sure that you'll receive UTF-8 helps as well:
<form action="form.php" method="post" enctype="multipart/form-data"
accept-charset="utf-8">

I work almost exclusively in UTF-8 (language irrelevant), but I've never
had to do any of the above. The mb_convert_encoding() from UTF-8 to
UTF-8 doesn't seem to make much sense?


/Per Jessen, Zürich
.



Relevant Pages

  • Re: LC_CTYPE=UTF-8 in ksh
    ... And the idea of UTF-8 is to be language independent, ... The "UTF-8" encoding is language ... shall define character classification, case conversion, and other ...
    (comp.unix.shell)
  • IIS 6.0 / UTF-8 Include File Issue
    ... All the language is included in variables in UTF-8 include files. ... IIS seems to implicitly think the page is UTF for text inputs. ... Just making all the pages UTF-8 causes is other display problems as IIS 6.0 ...
    (microsoft.public.inetserver.iis)
  • Re: Attention: European C/C++/C#/Java Programmers-Call for Input
    ... For any language using a Latin ... script for identifiers, the effective string length is 1.0x or rare ... The new programming language supports fonts, ... predates UNICODE and UTF-8 BTW) Additional ...
    (comp.arch.embedded)
  • Re: languages and PHP
    ... I work almost exclusively in UTF-8 (language irrelevant), ... Be careful about breaking strings tho' as the xgettext crawler file will ... name of the gettext function which is quite common). ...
    (php.general)
  • Re: Setting dynamically the Greek charset in Firefox ?
    ... And why can't you use UTF-8 and forget about all this encoding-switching? ... Greek users often have their browser's encoding set to ... Does inline frames inherit the language from ... The wizard (i.e. the inner frame making DHTML with Javascript) is the ...
    (comp.lang.javascript)