diff options
author | Pierre Ossman <ossman@cendio.se> | 2016-01-22 16:40:59 +0100 |
---|---|---|
committer | Pierre Ossman <ossman@cendio.se> | 2019-07-01 10:49:15 +0200 |
commit | 56fa7821560a60db39195e8c81d16b46e8f972c2 (patch) | |
tree | cc2013baaa127f3e6db22de64155b0fd0c85c4a9 /unix/xserver/hw/vnc/RFBGlue.cc | |
parent | 66f1db543b425f6fe64d437477e6f78924ec57be (diff) | |
download | tigervnc-56fa7821560a60db39195e8c81d16b46e8f972c2.tar.gz tigervnc-56fa7821560a60db39195e8c81d16b46e8f972c2.zip |
Add UTF-8 to/from ISO 8859-1 conversion routines
We convert between UTF-8 and ISO 8859-1 (latin 1) in several places
so create some common routines for this.
Diffstat (limited to 'unix/xserver/hw/vnc/RFBGlue.cc')
-rw-r--r-- | unix/xserver/hw/vnc/RFBGlue.cc | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/unix/xserver/hw/vnc/RFBGlue.cc b/unix/xserver/hw/vnc/RFBGlue.cc index d9c456e8..f108fae4 100644 --- a/unix/xserver/hw/vnc/RFBGlue.cc +++ b/unix/xserver/hw/vnc/RFBGlue.cc @@ -220,6 +220,24 @@ char* vncConvertLF(const char* src, size_t bytes) } } +char* vncLatin1ToUTF8(const char* src, size_t bytes) +{ + try { + return latin1ToUTF8(src, bytes); + } catch (...) { + return NULL; + } +} + +char* vncUTF8ToLatin1(const char* src, size_t bytes) +{ + try { + return utf8ToLatin1(src, bytes); + } catch (...) { + return NULL; + } +} + void vncStrFree(char* str) { strFree(str); |