From 4d05a35652a856467419d7d43e99f5a04f4bc4fd Mon Sep 17 00:00:00 2001 From: "ftang%netscape.com" Date: Thu, 14 Jan 1999 08:22:31 +0000 Subject: [PATCH] fix the 0x00-0x20 and 0x7f problem nsUnicodeDecodeUtil.cpp git-svn-id: svn://10.0.0.236/trunk@17729 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/intl/uconv/src/nsUnicodeDecodeUtil.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/mozilla/intl/uconv/src/nsUnicodeDecodeUtil.cpp b/mozilla/intl/uconv/src/nsUnicodeDecodeUtil.cpp index 6552c33c3fc..b8bef8dc115 100644 --- a/mozilla/intl/uconv/src/nsUnicodeDecodeUtil.cpp +++ b/mozilla/intl/uconv/src/nsUnicodeDecodeUtil.cpp @@ -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;