[webkit-dev] API in webkit to convert Unicode <--> HTML named entities?

Dan Wood dw43031apple at karelia.com
Mon Jul 21 13:27:42 PDT 2008


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 "&#x0441;" 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....





More information about the webkit-dev mailing list