Changeset 18936 for S60/trunk/WebCore

Show
Ignore:
Timestamp:
01/18/07 08:03:51 (2 years ago)
Author:
yongjzha
Message:

2007-01-18 sareen <shyam.sareen@yahoo.com>

Reviewed by Yongjun.
DESC: Wrong rendering of danish national characters for UTF8 coded web pages.(TSW ID: TMCN-6UQNXY)

Additional fix.

http://bugs.webkit.org/show_bug.cgi?id=12217

WARNING: NO TEST CASES ADDED OR CHANGED

  • kwq/KWQTextCodec.cpp: (validateUtf8):
Location:
S60/trunk/WebCore
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • S60/trunk/WebCore/ChangeLog

    r18935 r18936  
     12007-01-18  sareen  <shyam.sareen@yahoo.com> 
     2 
     3        Reviewed by Yongjun. 
     4        DESC:  Wrong rendering of danish national characters for UTF8 coded web pages.(TSW ID: TMCN-6UQNXY) 
     5               Additional fix. 
     6        http://bugs.webkit.org/show_bug.cgi?id=12217 
     7 
     8        WARNING: NO TEST CASES ADDED OR CHANGED 
     9 
     10        * kwq/KWQTextCodec.cpp: 
     11        (validateUtf8): 
     12 
    1132007-01-17  w3liu  <wei.liu@nokia.com> 
    214 
  • S60/trunk/WebCore/kwq/KWQTextCodec.cpp

    r18935 r18936  
    106106    int seqRem=0; 
    107107    bool isUtf8 = true; 
     108    bool wrongUtf8 = false; 
    108109    validMultiByteChars = 0; 
    109110    while (c<e) 
     
    117118                seqRem--; 
    118119            else { 
    119                 isUtf8 = false; 
    120                 break; 
     120                //Some times, there is wrong UTF-8 encoding in the characters. 
     121                //For example ( 0xd8 0x73). Then allow atleat one byte wrong encoding. 
     122                //This has been found in the real site. Also, this means here that is a  
     123                //ASCII character.  ASCII can be handled in the UTF-8 also.  
     124                wrongUtf8 = true; 
    121125            } 
    122126            if (seqRem==0) 
     
    139143            break; 
    140144        } 
     145        if ( wrongUtf8 ){ 
     146             if( seqRem == 1 ){ 
     147                 seqRem--;  
     148                 wrongUtf8 = false; 
     149             } 
     150             else { 
     151                 isUtf8 = false; 
     152                 break;  
     153             } 
     154         } //end if ( wrongUtf8 ) 
    141155        c++; 
    142     } 
     156    } //end while 
    143157    return isUtf8; 
    144158}