Re:Unitools – A suite of tools for working with Unicode in t...
by ygra on Wednesday March 02, 2016 @10:01AM
(#11210295)
It generally changes characters to numerical character references, not HTML character entities (which, incidentally, are a rather limited set of characters and pretty much useless these days – they were useful to include a few non-ASCII latin characters from Latin 1 in the mid-90s into HTML pages with browser charset detection messing things up if included directly; by now you just use Unicode and forget that a named set of entities ever existed).
[ Parent
| on HN ]
Re:Unitools – A suite of tools for working with Unicode in t...
by vmorgulis on Wednesday March 02, 2016 @10:10AM
(#11210351)
>...by now you just use Unicode and forget that a named set of entities ever existed...
OK.
When I was in PHP, I often used "htmlspeciachars()" and it does this kind of transform. That's why I tried that.
http://php.net/manual/en/function.htmlspecialchars.php
I had some problems too with " " because it's 160 in ASCII and not a whitespace (32).
Edit: 160
Re:Unitools – A suite of tools for working with Unicode in t...
by ygra on Wednesday March 02, 2016 @10:34AM
(#11210537)
The non-breaking space is certainly not 256 in ASCII (ASCII only extends to 127) and not even in Latin 1 (goes up to 255) and also not in Unicode – it's 160. While you can use in HTML you can also use   or  , both of which work in XML as well. And since numeric and hexadecimal character references are much easier to generate (you don't need a lookup table) I'd say they're a far nicer choice these days.
Re:Unitools – A suite of tools for working with Unicode in t...
by vmorgulis on Wednesday March 02, 2016 @10:39AM
(#11210571)
> ... in HTML you can also use   or   ...
Yes! You're right.
>... I'd say they're a far nicer choice these days.
It was a long time ago for a scrapping project (garbage HTML).