[webkit-dev] API in webkit to convert Unicode <--> HTML named entities?
eric at webkit.org
Mon Jul 21 15:07:15 PDT 2008
WebKit has no ability to create named entities from unicode chars. We
only have functions to go the other way (from names to unicode chars).
We've never written such support, so you'd have to write your own.
On Mon, Jul 21, 2008 at 1:27 PM, Dan Wood <dw43031apple at karelia.com> wrote:
> On Jul 21, 2008, at 12:53 PM, Eric Seidel wrote:
>> Would be very easy to build for yourself.
>> You could build it from our HTMLEntityNames.in or from the HTML DTD.
> Right, however that's what I'm trying to avoid. Since the data and
> functionality are *already* in webkit, it seems a shame for me (and
> all the other apps out there) to have to roll their own.
> On Jul 21, 2008, at 1:04 PM, Alexey Proskuryakov wrote:
>> Not a specific API, but if you make WebKit parse the text (e.g. with
>> loadHTMLString:baseURL:), it will be available via DOM methods as
>> Unicode characters. I do not think that there is any way to make
>> WebKit do the conversion to named entities - but maybe numeric
>> entities like "с" would meet your requirements? I'm not quite
>> sure what you need to achieve though.
> Yeah, that's one approach but it is way overkill for many needs, and
> invokes threads that aren't what you want for a simple function, and
> also only go from named entity into rendered Unicode character, and
> not the opposite (as you mention). I want the named entities rather
> than numbered for human-coder-readability....
> webkit-dev mailing list
> webkit-dev at lists.webkit.org
More information about the webkit-dev