Diffstat (limited to 'noncore/unsupported/qpdf/UTF8.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/unsupported/qpdf/UTF8.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/noncore/unsupported/qpdf/UTF8.h b/noncore/unsupported/qpdf/UTF8.h new file mode 100644 index 0000000..aacf663 --- a/dev/null +++ b/noncore/unsupported/qpdf/UTF8.h @@ -0,0 +1,24 @@ +//======================================================================== +// +// UTF8.h +// +// Copyright 2001 Derek B. Noonburg +// Modified for QPE by Robert Griebl +// +//======================================================================== + +#include <qstring.h> +#include <string.h> + +static int mapUTF8 ( Unicode u, char *buf, int bufSize ) +{ + QCString utf = QString ( QChar ( u )). utf8 ( ); + int len = utf. length ( ); + + if ( len <= bufSize ) { + ::memcpy ( buf, utf. data ( ), len ); + return len; + } + else + return 0; +} |