diff options
| author | Albrecht Schlosser <albrechts.fltk@online.de> | 2021-05-26 22:05:16 +0200 |
|---|---|---|
| committer | Albrecht Schlosser <albrechts.fltk@online.de> | 2021-05-26 22:05:16 +0200 |
| commit | 538079c7a02ed7d64536d8425fc7dad34589488a (patch) | |
| tree | 0d1193493ee4abe0dd218e4c93231514f41a2153 /test/utf8.cxx | |
| parent | 3b40d7a07fe7ee57765e02459aef1c416aace01b (diff) | |
Clarify demo code and add comment with "translated" string
Add the example string in binary "latin1" (ISO-8859-1) encoding
in a comment as clear text for reference (code is UTF-8 encoded).
Diffstat (limited to 'test/utf8.cxx')
| -rw-r--r-- | test/utf8.cxx | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/test/utf8.cxx b/test/utf8.cxx index 9151264f8..cfb41052a 100644 --- a/test/utf8.cxx +++ b/test/utf8.cxx @@ -566,13 +566,11 @@ public: int main(int argc, char** argv) { - int l; - const char *latin1 = - "\x41\x42\x43\x61\x62\x63\xe0\xe8\xe9\xef\xe2\xee\xf6\xfc\xe3\x31\x32\x33"; + const char *latin1 = // "ABCabcàèéïâîöüã123" + "\x41\x42\x43\x61\x62\x63\xe0\xe8\xe9\xef\xe2\xee\xf6\xfc\xe3\x31\x32\x33"; + char *utf8 = (char*) malloc(strlen(latin1) * 5 + 1); - l = 0; - // l = fl_latin12utf((const unsigned char*)latin1, strlen(latin1), utf8); - l = fl_utf8froma(utf8, (strlen(latin1) * 5 + 1), latin1, strlen(latin1)); + int l = fl_utf8froma(utf8, (strlen(latin1) * 5 + 1), latin1, strlen(latin1)); make_font_chooser(); extra_font = FL_TIMES_BOLD_ITALIC; |
