Skip to content

Commit c5c68a4

Browse files
committed
correct wrc UTF-8 to UTF-8 conversion
1 parent 7ef5585 commit c5c68a4

File tree

3 files changed

+22
-1
lines changed

3 files changed

+22
-1
lines changed

bld/rc/rc/c/param.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -759,7 +759,7 @@ static void initMBCodePage( void )
759759
}
760760
if( CmdLineParms.MBCharSupport == MB_UTF8 ) {
761761
SetUTF8toUnicode();
762-
SetUTF8toCP1252();
762+
SetUTF8toUTF8();
763763
} else if( CmdLineParms.MBCharSupport == MB_UTF8_KANJI ) {
764764
SetUTF8toUnicode();
765765
SetUTF8toCP932();

bld/rc/rc/c/unitable.c

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,19 @@ static size_t UTF8StringToCP1252( size_t len, const char *str, char *buf )
200200
return( ret );
201201
}
202202

203+
static size_t UTF8StringToUTF8( size_t len, const char *str, char *buf )
204+
/***********************************************************************
205+
* this function copy UTF-8 buffer to UTF-8 buffer
206+
*/
207+
{
208+
if( len > 0 ) {
209+
if( buf != NULL ) {
210+
memcpy( buf, str, len );
211+
}
212+
}
213+
return( len );
214+
}
215+
203216
static size_t UTF8StringToUnicode( size_t len, const char *str, char *buf )
204217
/**************************************************************************
205218
* this function convert UTF-8 buffer to 16-bit UNICODE buffer
@@ -279,3 +292,10 @@ RcStatus SetUTF8toCP1252( void )
279292
ConvToMultiByte = UTF8StringToCP1252;
280293
return( RS_OK );
281294
}
295+
296+
297+
RcStatus SetUTF8toUTF8( void )
298+
{
299+
ConvToMultiByte = UTF8StringToUTF8;
300+
return( RS_OK );
301+
}

bld/rc/rc/h/unitable.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,4 @@
1515
extern RcStatus SetUTF8toUnicode( void );
1616
extern RcStatus SetUTF8toCP932( void );
1717
extern RcStatus SetUTF8toCP1252( void );
18+
extern RcStatus SetUTF8toUTF8( void );

0 commit comments

Comments
 (0)