Diffstat (limited to 'noncore/unsupported/qpdf/UTF8.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/unsupported/qpdf/UTF8.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/noncore/unsupported/qpdf/UTF8.h b/noncore/unsupported/qpdf/UTF8.h index aacf663..95adecf 100644 --- a/noncore/unsupported/qpdf/UTF8.h +++ b/noncore/unsupported/qpdf/UTF8.h | |||
@@ -24 +24,15 @@ static int mapUTF8 ( Unicode u, char *buf, int bufSize ) | |||
24 | } | 24 | } |
25 | |||
26 | static int mapUCS2 ( Unicode u, char *buf, int bufSize) | ||
27 | { | ||
28 | if (u <= 0xffff) { | ||
29 | if (bufSize < 2) | ||
30 | return 0; | ||
31 | |||
32 | buf[0] = (char)((u >> 8) & 0xff); | ||
33 | buf[1] = (char)(u & 0xff); | ||
34 | return 2; | ||
35 | } | ||
36 | else | ||
37 | return 0; | ||
38 | } | ||