Fix utf escape support

This commit is contained in:
rexy712 2020-03-09 16:02:48 -07:00
parent a8ba1cc2fb
commit 46e86e248b

View File

@ -63,6 +63,8 @@ static int decode_unicode_escape(const char* str, uint32_t* high, uint32_t* low)
return *low = *high = 0;
}
*low = utf_strtol_4(str+8);
if(!*low)
return *low = *high = 0;
return 12;
}else{
*low = 0;
@ -163,6 +165,8 @@ char* irjp_convert_string(const char* str, RJP_index length, RJP_index* newlen){
//unicode escape
uint32_t high, low;
oldpos += (decode_unicode_escape(str+oldpos, &high, &low)-1);
if(high == 0)
return NULL;
newlength += (codepoint_strlen(utf_to_codepoint(high, low))-1);
}else{
++oldpos;