FLTK logo

[master] 538079c - Clarify demo code and add comment with "translated" string

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.commit  ]
 
Previous Message ]Next Message ]

[master] 538079c - Clarify demo code and add comment with "translated" string "Albrecht Schlosser" May 26, 2021  
 
commit 538079c7a02ed7d64536d8425fc7dad34589488a
Author:     Albrecht Schlosser <albrechts.fltk@online.de>
AuthorDate: Wed May 26 22:05:16 2021 +0200
Commit:     Albrecht Schlosser <albrechts.fltk@online.de>
CommitDate: Wed May 26 22:05:16 2021 +0200

    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).

 test/utf8.cxx | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git test/utf8.cxx test/utf8.cxx
index 9151264..cfb4105 100644
--- test/utf8.cxx
+++ 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;
Direct Link to Message ]
 
     
Previous Message ]Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.