Bug 75707: Some BIG5 characters can not be displayed properly in Solaris Trunk

add a boolean value to valid the med
checking in for ftang
This commit is contained in:
yokoyama%netscape.com 2001-07-13 20:42:34 +00:00
Родитель 4787fc9a45
Коммит bc50f1133e
3 изменённых файлов: 16 добавлений и 2 удалений

Просмотреть файл

@ -164,14 +164,18 @@ NS_IMETHODIMP nsUnicodeDecodeHelper::ConvertByMultiTable(
while ((srcLen > 0) && (dest < destEnd))
{
PRBool done= PR_FALSE;
PRBool passRangeCheck = PR_FALSE;
PRBool passScan = PR_FALSE;
for (i=0; (!done) && (i<aTableCount); i++)
{
if ((aRangeArray[i].min <= *src) && (*src <= aRangeArray[i].max))
{
passRangeCheck = PR_TRUE;
if (uScan(aShiftTable[i], NULL, src,
NS_REINTERPRET_CAST(PRUint16*, &med), srcLen,
(PRUint32 *)&bcr))
{
passScan = PR_TRUE;
done = uMapCode((uTable*) aMappingTable[i],
NS_STATIC_CAST(PRUint16, med),
NS_REINTERPRET_CAST(PRUint16*, dest));
@ -179,12 +183,20 @@ NS_IMETHODIMP nsUnicodeDecodeHelper::ConvertByMultiTable(
} // if Range
} // for loop
if(passRangeCheck && (! passScan))
{
res = NS_OK_UDEC_MOREINPUT;
break;
}
if(! done)
{
bcr = 1;
if (med < 0x20) {
if ((PRUint8)*src < 0x20) {
// somehow some table miss the 0x00 - 0x20 part
*dest = med;
*dest = *src;
} else if(*src == (PRUint8) 0xa0) {
// handle nbsp
*dest = 0x00a0;
} else {
// we need to decide how many byte we skip. We can use uScan to do this
for (i=0; i<aTableCount; i++)

Просмотреть файл

@ -156,6 +156,7 @@ NS_IMETHODIMP nsGBKToUnicode::ConvertNoBuff(const char* aSrc,
PRInt32 iSrcLength = (*aSrcLength);
PRInt32 iDestlen = 0;
nsresult rv=NS_OK;
*aSrcLength = 0;
for (i=0;i<iSrcLength;i++)
{

Просмотреть файл

@ -87,6 +87,7 @@ NS_IMETHODIMP nsHZToUnicode::ConvertNoBuff(
PRInt32 iDestlen = 0;
PRUint8 ch1, ch2;
nsresult res = NS_OK;
*aSrcLength=0;
for (i=0;i<iSrcLength;i++)
{
if ( iDestlen >= (*aDestLength) )