+2006-02-07 Adele Peterson <adele@apple.com>
+
+ - test for
+ <rdar://problem/3727939> Safari strips \0 characters from HTML tags making them valid
+
+ * fast/encoding/decoder-allow-null-chars.html
+ * fast/encoding/decoder-allow-null-chars-expected.txt
+
2006-02-07 Alexey Proskuryakov <ap@nypop.com>
Reviewed by Timothy.
+2006-02-07 Adele Peterson <adele@apple.com>
+
+ Reviewed by Maciej.
+
+ - Fixed <rdar://problem/3727939> Safari strips \0 characters from HTML tags making them valid
+
+ Test: fast/encoding/decoder-allow-null-chars.html
+
+ * kwq/KWQTextCodec.cpp:
+ (KWQTextDecoder::convertLatin1): Removed stripping of null characters
+ (unwanted): ditto.
+
2006-02-07 David Hyatt <hyatt@apple.com>
Land the skeleton of a PNG decoder for Win32.
{
ASSERT(_numBufferedBytes == 0);
- int i;
- for (i = 0; i != length; ++i) {
- if (s[i] == 0) {
- break;
- }
- }
- if (i == length) {
- return QString(reinterpret_cast<const char *>(s), length);
- }
-
- QString result("");
-
- result.reserve(length);
-
- result.append(reinterpret_cast<const char *>(s), i);
- int start = ++i;
- for (; i != length; ++i) {
- if (s[i] == 0) {
- if (start != i) {
- result.append(reinterpret_cast<const char *>(&s[start]), i - start);
- }
- start = i + 1;
- }
- }
- if (start != length) {
- result.append(reinterpret_cast<const char *>(&s[start]), length - start);
- }
-
- return result;
+ return QString(reinterpret_cast<const char *>(s), length);
}
QString KWQTextDecoder::convertUTF16(const unsigned char *s, int length)
return U_ZERO_ERROR;
}
-// We strip NUL characters because other browsers (at least WinIE) do.
// We strip replacement characters because the ICU converter for UTF-8 converts
// invalid sequences into replacement characters, but other browsers discard them.
// We strip BOM characters because they can show up both at the start of content
static inline bool unwanted(UniChar c)
{
switch (c) {
- case 0:
case replacementCharacter:
case BOM:
return true;