Disable the check for mixed Simplified and Traditional Chinese characters when determining whether to display IDN labels as unicode or punycode. Bug 857481, r=honzab

This commit is contained in:
Simon Montagu 2013-04-08 01:36:52 -07:00
parent 24c41ad61c
commit e8db6078f1
2 changed files with 9 additions and 2 deletions

View File

@ -752,7 +752,10 @@ bool nsIDNService::isLabelSafe(const nsAString &label)
int32_t lastScript = MOZ_SCRIPT_INVALID;
uint32_t previousChar = 0;
uint32_t savedNumberingSystem = 0;
// Simplified/Traditional Chinese check temporarily disabled -- bug 857481
#if 0
HanVariantType savedHanVariant = HVT_NotHan;
#endif
int32_t savedScript = -1;
@ -807,6 +810,9 @@ bool nsIDNService::isLabelSafe(const nsAString &label)
return false;
}
// Simplified/Traditional Chinese check temporarily disabled -- bug 857481
#if 0
// Check for both simplified-only and traditional-only Chinese characters
HanVariantType hanVariant = GetHanVariant(ch);
if (hanVariant == HVT_SimplifiedOnly || hanVariant == HVT_TraditionalOnly) {
@ -816,6 +822,7 @@ bool nsIDNService::isLabelSafe(const nsAString &label)
return false;
}
}
#endif
previousChar = ch;
}

View File

@ -172,10 +172,10 @@ const testcases = [
["万城", "xn--chq31v", false, true, true],
// Simplified-only and Traditional-only Chinese in the same label
["万萬城", "xn--chq31vsl1b", false, false, false],
["万萬城", "xn--chq31vsl1b", false, true, true],
// Traditional-only and Simplified-only Chinese in the same label
["萬万城", "xn--chq31vrl1b", false, false, false],
["萬万城", "xn--chq31vrl1b", false, true, true],
// Han and Latin and Bopomofo
["注音符号bopomofoㄅㄆㄇㄈ",