[AD] Smaller UTF-8 memory requirements

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


This is a followup to the message "How to get a Windows XP message
window with Allegro/MinGW" posted by N. Roy on Thu, 28 Oct 2004
19:54:08 -0400. It is a patch to follow more closely what is
explained at http://www.unicode.org/faq/utf_bom.html#37.

Index: docs/src/allegro._tx
===================================================================
RCS file: /cvsroot/alleg/allegro/docs/src/allegro._tx,v
retrieving revision 1.299
diff -u -r1.299 allegro._tx
--- docs/src/allegro._tx        17 Feb 2005 08:59:58 -0000      1.299
+++ docs/src/allegro._tx        23 Feb 2005 08:39:14 -0000
@@ -824,7 +824,7 @@
 whatever format you have told Allegro to use.
 
 By default, Allegro uses UTF-8 encoded text (U_UTF8). This is a 
-variable-width format, where characters can occupy anywhere from one to six 
+variable-width format, where characters can occupy anywhere from one to four
 bytes. The nice thing about it is that characters ranging from 0-127 are 
 encoded directly as themselves, so UTF-8 is upwardly compatible with 7-bit 
 ASCII ("Hello, World!" means the same thing regardless of whether you 
Index: src/unicode.c
===================================================================
RCS file: /cvsroot/alleg/allegro/src/unicode.c,v
retrieving revision 1.31
diff -u -r1.31 unicode.c
--- src/unicode.c       31 Oct 2004 01:47:35 -0000      1.31
+++ src/unicode.c       23 Feb 2005 08:39:15 -0000
@@ -470,7 +470,7 @@
 static UTYPE_INFO utypes[] =
 {
    { U_ASCII,    ascii_getc,    ascii_getx,    ascii_setc,    ascii_width,   ascii_cwidth,   ascii_isok,    1    },
-   { U_UTF8,     utf8_getc,     utf8_getx,     utf8_setc,     utf8_width,    utf8_cwidth,    utf8_isok,     6     },
+   { U_UTF8,     utf8_getc,     utf8_getx,     utf8_setc,     utf8_width,    utf8_cwidth,    utf8_isok,     4     },
    { U_UNICODE,  unicode_getc,  unicode_getx,  unicode_setc,  unicode_width, unicode_cwidth, unicode_isok,  2  },
    { U_ASCII_CP, ascii_cp_getc, ascii_cp_getx, ascii_cp_setc, ascii_width,   ascii_cwidth,   ascii_cp_isok, 1 },
    { 0,          NULL,          NULL,          NULL,          NULL,          NULL,           NULL,          0                     },





Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/