mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-10 01:08:21 +00:00
fix the 0x00-0x20 and 0x7f problem nsUnicodeDecodeUtil.cpp
This commit is contained in:
parent
da4a8ab725
commit
0a4bb956c9
@ -86,7 +86,10 @@ NS_IMETHODIMP nsUnicodeDecodeUtil::Convert(
|
||||
if(uScan(aShiftTable, (PRInt32*) 0, src, &med, srclen, &scanlen)) {
|
||||
uMapCode((uTable*) aMappingTable,med, dest);
|
||||
if(*dest == NOMAPPING) {
|
||||
if(nsIUnicodeDecoder::kOnError_Signal == aBehavior)
|
||||
if((*src < 0x20) || (0x7F == *src))
|
||||
{ // somehow some table miss the 0x00 - 0x20 part
|
||||
*dest = (PRUnichar) *src;
|
||||
} else if(nsIUnicodeDecoder::kOnError_Signal == aBehavior)
|
||||
{
|
||||
*aSrcLength -= srclen;
|
||||
*aDestLength = validlen;
|
||||
@ -153,7 +156,10 @@ NS_IMETHODIMP nsUnicodeDecodeUtil::Convert(
|
||||
}
|
||||
}
|
||||
if(i == numberOfTable) {
|
||||
if(nsIUnicodeDecoder::kOnError_Signal == aBehavior)
|
||||
if((*src < 0x20) || (0x7F == *src))
|
||||
{ // somehow some table miss the 0x00 - 0x20 part
|
||||
*dest = (PRUnichar) *src;
|
||||
} else if(nsIUnicodeDecoder::kOnError_Signal == aBehavior)
|
||||
{
|
||||
*aSrcLength -= srclen;
|
||||
*aDestLength = validlen;
|
||||
|
Loading…
x
Reference in New Issue
Block a user