[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Erw-devel] MS IE vs. Mozilla - UTF?
From: |
erw-devel |
Subject: |
Re: [Erw-devel] MS IE vs. Mozilla - UTF? |
Date: |
05 Sep 2003 17:19:37 +0200 |
On Tue, 2003-08-19 at 16:05, address@hidden wrote:
> If I open a list window and add try to filter some of the text data
> (which happens to be Japanese), I get very different responses from the
> two browsers:
> Mozilla works just fine -- I type in some kanji, and the filter works
> just fine
> IE doesn't -- no hits on the same filter condition.
>
> Turning on debug-level logging, I notice that the Mozilla requests look
> like they're getting translated properly (they appear as gibberish on my
> non-UTF display), while the IE reqeusts look like 5ABF57AC.
>
There's a small problem, in this case. To escape the content of filters,
I use the JS escape() function, which however guarantees *just* to
escape ISO Latin 1 characters. This means that presently it's a mess.
The only solution is to manually code in UTF-8 the javascript string
(which is in Unicode) when UTF-8 is on. Probably the escape() function
found in IE is trying to be "smart" and coding Unicode characters as
they would be in a JS string, that is, %uXXXX. I do not understand
exactly what happens with Mozilla though. It shouldn't work either 8^).
> Further inspection turns out this: Mozilla's handing actual binary UTF
> data in on its request (I believe), while IE hands in entities like
> %u5ABF. Note, however, that these entities are all 4 characters, and do
> not have a trailing semicolon -- this is important, since they get
> handled by "html2utf()" in ERW.php; and the Mozilla data gets handed
> through untouched (since it's already binary, and doesn't contain "%u"),
> while the IE data _also_ gets handed in untouched, except for removal of
> %u (since it doesn't have a final semicolon).
>
> I'm afraid I'm going to have to rewrite html2utf() so that it handles
> data this way:
> while (strstr("%u", $workstring))
> {
> $currstring = substr($workstring, 2, 4);
> $workstring = substr($workstring, 6, strlen($workstring));
> // work magic on $currstring and add it to output
> }
I'm a bit lost... I do not have an html2utf() function...
Ciao,
seba
- Re: [Erw-devel] MS IE vs. Mozilla - UTF?,
erw-devel <=