mirror of
https://github.com/michaelrsweet/pdfio.git
synced 2025-08-29 15:22:06 +02:00
Update documentation and pdf2text example (Issue #95)
This commit is contained in:
@@ -3797,9 +3797,19 @@ write_string(pdfio_stream_t *st, // I - Stream
|
||||
|
||||
if (unicode)
|
||||
{
|
||||
// Write a two-byte character...
|
||||
if (!pdfioStreamPrintf(st, "%04X", ch))
|
||||
return (false);
|
||||
// Write UTF-16 in hex...
|
||||
if (ch < 0x100000)
|
||||
{
|
||||
// Two-byte UTF-16
|
||||
if (!pdfioStreamPrintf(st, "%04X", ch))
|
||||
return (false);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Four-byte UTF-16
|
||||
if (!pdfioStreamPrintf(st, "%04X%04X", 0xd800 | ((ch >> 10) & 0x03ff), 0xdc00 | (ch & 0x03ff)))
|
||||
return (false);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
Reference in New Issue
Block a user