Changeset 20667 in webkit
- Timestamp:
- Apr 2, 2007 1:38:53 PM (17 years ago)
- Location:
- S60/branches/3.1m/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
S60/branches/3.1m/WebCore/ChangeLog
r20655 r20667 1 2007-03-30 jadhan <jade.han@nokia.com> 2 3 Reviewed by Zalan <zbujtas@gmail.com> 4 DESC: special handling for utf8 encoding of danish character. Merged fix from 3.2 to 3.1 5 http://bugs.webkit.org/show_bug.cgi?id=13231 6 7 WARNING: NO TEST CASES ADDED OR CHANGED 8 9 * ChangeLog: 10 * kwq/KWQTextCodec.cpp: 11 (validateUtf8): 12 1 13 2007-04-02 yongjzha <yonjun.zhang@nokia.com> 2 14 -
S60/branches/3.1m/WebCore/kwq/KWQTextCodec.cpp
r18937 r20667 106 106 int seqRem=0; 107 107 bool isUtf8 = true; 108 bool wrongUtf8 = false; 108 109 validMultiByteChars = 0; 109 110 while (c<e) 110 111 { 112 if( seqRem == 0 ) 113 b = c; 111 114 // test validity of a multibyte sequence 112 115 if (seqRem>0) { … … 115 118 seqRem--; 116 119 else { 117 isUtf8 = false; 118 break; 120 //Some times, there is wrong UTF-8 encoding in the characters. 121 //For example ( 0xd8 0x73). Then allow at least one byte wrong encoding. 122 //This has been found in the real site. Also, this means here that is an 123 //ASCII character. ASCII can be handled in the UTF-8 also. 124 wrongUtf8 = true; 119 125 } 120 126 if (seqRem==0) … … 137 143 break; 138 144 } 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 ) 139 155 c++; 140 } 156 } //end while 141 157 return isUtf8; 142 158 }
Note: See TracChangeset
for help on using the changeset viewer.