[webkit-help] How can I write content of a TextRun to a file

n179911 n179911 at gmail.com
Tue Jan 19 23:32:38 PST 2010


Julien,

I followed your example by doing this:
String characters = String(run.characters()).substring(from, to - from);
CString characters = characters.latin1();
printf ("(%s)\n",characters.data());

But it has problem where there is entity reference in the TextRun,
e.g. "‎1 hour ago‎"

The above code will print "?1 hour ago?"

And if I switch to use CString characters = characters.utf8();

The following will print (with hex dump, there is a hex 0xe2808e
before "1 hour ago"). And i think 0xe2808e is utf character for
LEFT-TO-RIGHT mark.

00020f20: 3928 e280 8e31 2068 6f75 7220 6167 6fe2 9(...1 hour ago.
00020f30: 808e 2978 0a64 7261 7754 6578 7420 3133 ..)

But when I do 'inspect element', the browser just shows "1 hour ago".
My question is how can the browser skips this entity reference
character for string like "‎1 hour ago‎"

Thank you.


On Sun, Jan 17, 2010 at 3:32 PM, Julien Chaffraix
<julien.chaffraix at gmail.com> wrote:
> On Sun, Jan 17, 2010 at 3:22 PM, n179911 <n179911 at gmail.com> wrote:
>> Thanks. And I get compilation error in
>> String characters = run.characters().substring(from, to - from);
>
> My bad, I should have written:
>
> String characters = String(run.characters()).substring(from, to - from);
>
> Regards,
> Julien
>


More information about the webkit-help mailing list