Show
Ignore:
Timestamp:
08/25/07 22:49:09 (15 months ago)
Author:
krobillard
Message:

UTF-8 strings can now be read.
ur_makeString() now takes UCell argument.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/thune/thread_safe/print.c

    r452 r453  
    3131 
    3232 
    33 extern int copyUtf16ToAscii( char* dest, const uint16_t* src, int len ); 
     33extern int copyUcs2ToUtf8( char* dest, const uint16_t* src, int len ); 
    3434 
    3535 
     
    4343 
    4444 
    45 void ur_strCatUtf16( UString* str, const uint16_t* cp, int len ) 
    46 { 
    47     if( (str->used + len) > str->avail ) 
    48         EXPAND( str, len ); 
    49     str->used += copyUtf16ToAscii( str->ptr.c + str->used, cp, len ); 
     45void ur_strCatUcs2( UString* str, const uint16_t* cp, int len ) 
     46{ 
     47    EXPAND( str, len * 2 ); 
     48    str->used += copyUcs2ToUtf8( str->ptr.c + str->used, cp, len ); 
    5049} 
    5150 
     
    7877 
    7978                case UR_ENC_UTF16: 
    80                     ur_strCatUtf16( out, str2->ptr.u16 + si, used ); 
     79                    ur_strCatUcs2( out, str2->ptr.u16 + si, used ); 
    8180                    break; 
    8281            } 
     
    271270#define APP_STR_FUNC    _appendStringUtf16 
    272271#define APP_STR_T       uint16_t 
    273 #define APP_STR_COPY    ur_strCatUtf16 
     272#define APP_STR_COPY    ur_strCatUcs2 
    274273#include "print_string.c" 
    275274