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, |
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 |
|
|
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 ); |