/[winpt]/trunk/Src/wptUTF8.cpp
ViewVC logotype

Diff of /trunk/Src/wptUTF8.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 180 by twoaday, Mon Dec 19 13:05:59 2005 UTC revision 181 by twoaday, Tue Mar 14 11:01:22 2006 UTC
# Line 33  Line 33 
33  #include "wptErrors.h"  #include "wptErrors.h"
34    
35    
36  static u16 latin2_unicode[128] = {  static WORD latin2_unicode[128] = {
37      0x0080,0x0081,0x0082,0x0083,0x0084,0x0085,0x0086,0x0087,      0x0080,0x0081,0x0082,0x0083,0x0084,0x0085,0x0086,0x0087,
38      0x0088,0x0089,0x008A,0x008B,0x008C,0x008D,0x008E,0x008F,      0x0088,0x0089,0x008A,0x008B,0x008C,0x008D,0x008E,0x008F,
39      0x0090,0x0091,0x0092,0x0093,0x0094,0x0095,0x0096,0x0097,      0x0090,0x0091,0x0092,0x0093,0x0094,0x0095,0x0096,0x0097,
# Line 54  static u16 latin2_unicode[128] = { Line 54  static u16 latin2_unicode[128] = {
54    
55    
56  static const char *active_charset_name = "iso-8859-1";  static const char *active_charset_name = "iso-8859-1";
57  static u16 *active_charset = NULL;  static WORD *active_charset = NULL;
58  static int no_translation = 0;  static int no_translation = 0;
59    
60    
# Line 127  native_to_utf8( const char *string ) Line 127  native_to_utf8( const char *string )
127        buffer = (char *)malloc( length + 1 );        buffer = (char *)malloc( length + 1 );
128        for(p=(byte *)buffer, s=(byte *)string; *s; s++ ) {        for(p=(byte *)buffer, s=(byte *)string; *s; s++ ) {
129            if( *s & 0x80 ) {                        if( *s & 0x80 ) {            
130                u16 val = active_charset[ *s & 0x7f ];                WORD val = active_charset[ *s & 0x7f ];
131                if( val < 0x0800 ) {                                if( val < 0x0800 ) {                
132                    *p++ = 0xc0 | ( (val >> 6) & 0x1f );                    *p++ = 0xc0 | ( (val >> 6) & 0x1f );
133                    *p++ = 0x80 | (  val & 0x3f );                    *p++ = 0x80 | (  val & 0x3f );

Legend:
Removed from v.180  
changed lines
  Added in v.181

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26