Re: [fp-dev] [PATCH] proper use of htmlentities
Moved to GitHub: https://github.com/flatpressblog/flatpress
Brought to you by:
real_nowhereman
|
From: Naoki H. <n...@h7...> - 2006-11-17 21:00:52
|
NoWhereMan wrote:
> it looks like a way to unescape sequences of entities... something like
> that...
> if it finds &entity; it won't change it into &entity; maybe... :P
I see... Besides, today's WP seems to be using:
$text = str_replace('&&', '&&', $text);
$text = str_replace('&&', '&&', $text);
$text = preg_replace('/&(?:$|([^#])(?![a-z1-4]{1,8};))/', '&$1',
$text);
>> I was using xemacs when I used to work on Windows :-)
>
> cool, let's start a flamewar about vim (I use vim) :D
Okay, vim sucks, emacs rules!! heheh.
Actually, I always use vim only when I am working as "root" because it
forces me to be really cautious ;-)
>> $ find . \( -name "*.php" -o -name "*.tpl" \) | xargs perl -pi -e
>> 's/<form /<form accept-charset="utf-8" /'
>
> Is this really needed? I thought it would have better if the user agents
> could figure it out theirselves from the page encoding. BTW if we really
> drop other encs for utf... :/
> I'm not sure...
The thing is, browsers don't have to send a message in the same encoding
of the page. This used to be a typical problem in Japanese since even
if the page encoding is "euc-jp", some of browsers can send a message in
"sjis". Maybe there is no issue nowadays but specifying explicitly is
better, I suppose.
In terms of dropping other encodings, I am sure that it just makes more
of people's life much easier than otherwise.
I don't say there is no reason but I can't think of any compelling
reason why someone really wants to use something other than UTF-8 unless
it's UTF-16.
Thanks,
-- Hiroshima
|