diff options
| author | Matthias Melcher <fltk@matthiasm.com> | 2009-09-17 20:40:02 +0000 |
|---|---|---|
| committer | Matthias Melcher <fltk@matthiasm.com> | 2009-09-17 20:40:02 +0000 |
| commit | c0e4cf48a402bc355558b7a99160da0659cfbfa2 (patch) | |
| tree | ceddd45e7ed9e722f1d608cc3ed363346fe4cc92 /test/utf8.cxx | |
| parent | 9ba790be3bfc78060a54ddc6038b887a8033a800 (diff) | |
Starting to allow international (unicode) keystrokes as shortcuts.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@6877 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'test/utf8.cxx')
| -rw-r--r-- | test/utf8.cxx | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/test/utf8.cxx b/test/utf8.cxx index 40eb12c90..ee418b44b 100644 --- a/test/utf8.cxx +++ b/test/utf8.cxx @@ -490,9 +490,10 @@ public: case FL_DND_RELEASE: return 1; case FL_PASTE: { + static const char lut[] = "0123456789abcdef"; const char *t = Fl::event_text(); int i, n; - fl_utf8decode(t, t+Fl::event_length(), &n); + unsigned int ucode = fl_utf8decode(t, t+Fl::event_length(), &n); if (n==0) { value(""); return 1; @@ -501,10 +502,15 @@ public: for (i=0; i<n; i++) *d++ = t[i]; *d++ = ' '; for (i=0; i<n; i++) { - const char lut[] = "0123456789abcdef"; *d++ = '\\'; *d++ = 'x'; *d++ = lut[(t[i]>>4)&0x0f]; *d++ = lut[t[i]&0x0f]; } + *d++ = ' '; + *d++ = '0'; + *d++ = 'x'; + *d++ = lut[(ucode>>20)&0x0f]; *d++ = lut[(ucode>>16)&0x0f]; + *d++ = lut[(ucode>>12)&0x0f]; *d++ = lut[(ucode>>8)&0x0f]; + *d++ = lut[(ucode>>4)&0x0f]; *d++ = lut[ucode&0x0f]; *d++ = 0; value(buffer); } |
