From a6b9111361d18d29511b819c050419299e55c7f7 Mon Sep 17 00:00:00 2001 From: "ftang%netscape.com" Date: Wed, 22 Sep 1999 03:20:21 +0000 Subject: [PATCH] fix utf converson bug --- xpcom/ds/nsTextFormater.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xpcom/ds/nsTextFormater.cpp b/xpcom/ds/nsTextFormater.cpp index 25114f37242c..c18ba74e6b34 100644 --- a/xpcom/ds/nsTextFormater.cpp +++ b/xpcom/ds/nsTextFormater.cpp @@ -16,7 +16,7 @@ * Reserved. */ -/* The code are copy from mozilla/nsprpub/src/io/prprf.c */ +/* The code are copy from rev 3.7 mozilla/nsprpub/src/io/prprf.c */ /* ** Port from prprf.c by : Frank Yung-Fong Tang */ @@ -480,7 +480,7 @@ static PRUnichar* UTF8ToUCS2(const char *aSrc, PRUint32 aSrcLen, PRUnichar* aDes if(0x80 == (0xC0 & (*in))) { PRUint32 tmp = (*in); - int shift = state * 6; + int shift = (state-1) * 6; tmp = (tmp << shift ) & ( 0x0000003FL << shift); ucs4 |= tmp; if(0 == --state)