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).
This commit is contained in:
Albrecht Schlosser
2021-05-26 22:05:16 +02:00
parent 3b40d7a07f
commit 538079c7a0
+4 -6
View File
@@ -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;