Use ASCII-compatible fallback if an encoder has no values defined for code points below U+0020. Bug 399257, r=jshin
This commit is contained in:
@@ -62,8 +62,13 @@ nsresult nsUnicodeEncodeHelper::ConvertByTable(
|
||||
|
||||
while (src < srcEnd) {
|
||||
if (!uMapCode((uTable*) aMappingTable, static_cast<PRUnichar>(*(src++)), reinterpret_cast<PRUint16*>(&med))) {
|
||||
res = NS_ERROR_UENC_NOMAPPING;
|
||||
break;
|
||||
if (*(src - 1) < 0x20) {
|
||||
// some tables are missing the 0x00 - 0x20 part
|
||||
med = *(src - 1);
|
||||
} else {
|
||||
res = NS_ERROR_UENC_NOMAPPING;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
PRBool charFound;
|
||||
|
||||
Reference in New Issue
Block a user