author | sandman <sandman> | 2002-05-23 23:51:52 (UTC) |
---|---|---|
committer | sandman <sandman> | 2002-05-23 23:51:52 (UTC) |
commit | 2f3bb7b07f833273d966d41813e68bfe8b9d8d76 (patch) (unidiff) | |
tree | 00beb1bd9e7f4ba79e22334a0d258269b28f4564 /noncore/unsupported/qpdf/UTF8.h | |
parent | 6e82b45dd416ceeba78765717b700e853c96a137 (diff) | |
download | opie-2f3bb7b07f833273d966d41813e68bfe8b9d8d76.zip opie-2f3bb7b07f833273d966d41813e68bfe8b9d8d76.tar.gz opie-2f3bb7b07f833273d966d41813e68bfe8b9d8d76.tar.bz2 |
Port to xpdf 1.01
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 | |||
@@ -22,3 +22,17 @@ static int mapUTF8 ( Unicode u, char *buf, int bufSize ) | |||
22 | else | 22 | else |
23 | return 0; | 23 | return 0; |
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 | } | ||