Reviewed by Darin.
authormjs <mjs@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 27 Feb 2006 19:30:55 +0000 (19:30 +0000)
committermjs <mjs@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 27 Feb 2006 19:30:55 +0000 (19:30 +0000)
        - add new TextEncoding stuff to win32 build
        http://bugzilla.opendarwin.org/show_bug.cgi?id=7491

        * WebCore.vcproj/WebCore/WebCore.vcproj:
        * WebCore.vcproj/WebCore/build-generated-files.sh:
        * platform/StreamingTextDecoder.cpp:
        (WebCore::StreamingTextDecoder::convertUTF16):
        * platform/TextEncoding.cpp:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@13010 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebCore/ChangeLog
WebCore/WebCore.vcproj/WebCore/WebCore.vcproj
WebCore/WebCore.vcproj/WebCore/build-generated-files.sh
WebCore/platform/StreamingTextDecoder.cpp
WebCore/platform/TextEncoding.cpp

index a1f2104..1988461 100644 (file)
@@ -1,3 +1,16 @@
+2006-02-27  Maciej Stachowiak  <mjs@apple.com>
+
+        Reviewed by Darin.
+
+        - add new TextEncoding stuff to win32 build
+        http://bugzilla.opendarwin.org/show_bug.cgi?id=7491
+
+        * WebCore.vcproj/WebCore/WebCore.vcproj:
+        * WebCore.vcproj/WebCore/build-generated-files.sh:
+        * platform/StreamingTextDecoder.cpp:
+        (WebCore::StreamingTextDecoder::convertUTF16):
+        * platform/TextEncoding.cpp:
+
 2006-02-27  Darin Adler  <darin@apple.com>
 
         - try to fix Windows build
index 411b583..b36256b 100644 (file)
                                >\r
                        </File>\r
                        <File\r
+                               RelativePath="..\..\platform\CharsetNames.cpp"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\..\platform\CharsetNames.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
                                RelativePath="..\..\platform\Color.cpp"\r
                                >\r
                        </File>\r
                                >\r
                        </File>\r
                        <File\r
+                               RelativePath="..\..\platform\StreamingTextDecoder.cpp"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\..\platform\StreamingTextDecoder.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
                                RelativePath="..\..\platform\String.cpp"\r
                                >\r
                        </File>\r
                                >\r
                        </File>\r
                        <File\r
+                               RelativePath="..\..\platform\TextEncoding.cpp"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\..\platform\TextEncoding.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
                                RelativePath="..\..\platform\Timer.cpp"\r
                                >\r
                        </File>\r
                        Name="dom"\r
                        >\r
                        <File\r
+                               RelativePath="..\..\dom\AtomicStringList.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
                                RelativePath="..\..\dom\CDATASectionImpl.cpp"\r
                                >\r
                        </File>\r
                                >\r
                        </File>\r
                        <File\r
-                               RelativePath="..\..\dom\AtomicStringList.h"\r
-                               >\r
-                       </File>\r
-                       <File\r
                                RelativePath="..\..\dom\dom_elementimpl.cpp"\r
                                >\r
                        </File>\r
                                >\r
                        </File>\r
                        <File\r
-                               RelativePath="..\..\dom\QualifiedName.cpp"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\..\dom\QualifiedName.h"\r
-                               >\r
-                       </File>\r
-                       <File\r
                                RelativePath="..\..\dom\dom_xmlimpl.cpp"\r
                                >\r
                        </File>\r
                                >\r
                        </File>\r
                        <File\r
+                               RelativePath="..\..\dom\QualifiedName.cpp"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\..\dom\QualifiedName.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
                                RelativePath="..\..\dom\TextImpl.cpp"\r
                                >\r
                        </File>\r
index 9bf309d..cd056ee 100755 (executable)
@@ -62,6 +62,12 @@ if [ platform/ColorData.gperf -nt "$DerivedSourcesDir/ColorData.c" ]; then
   gperf -CDEot -L 'ANSI-C' -k '*' -N findColor platform/ColorData.gperf > "$DerivedSourcesDir/ColorData.c"
 fi
 
+# Generate the charset name table
+if [ platform/character-sets.txt -nt "$DerivedSourcesDir/CharsetData.cpp" -o platform/win/win-encodings.txt -nt "$DerivedSourcesDir/CharsetData.cpp" -o platform/make-charset-table.pl -nt "$DerivedSourcesDir/CharsetData.cpp" ]; then
+  echo "Generating character set name table..."
+  platform/make-charset-table.pl platform/character-sets.txt platform/win/win-encodings.txt "" > "$DerivedSourcesDir/CharsetData.cpp"
+fi
+
 # Generate the lookup tables for the JS bindings
 
 if [ ../JavaScriptCore/kjs/create_hash_table -nt "$DerivedSourcesDir/domparser.lut.h" -o khtml/ecma/domparser.cpp -nt "$DerivedSourcesDir/domparser.lut.h" ]; then
index 823b126..d87ed49 100644 (file)
@@ -27,6 +27,9 @@
 #include "StreamingTextDecoder.h"
 
 #include <kxmlcore/Assertions.h>
+#include <utility>
+
+using std::min;
 
 namespace WebCore {
 
@@ -92,7 +95,7 @@ QString StreamingTextDecoder::convertUTF16(const unsigned char *s, int length)
     
     while (len > 1) {
         UChar buffer[ConversionBufferSize];
-        int runLength = MIN(len / 2, sizeof(buffer) / sizeof(buffer[0]));
+        int runLength = min(len / 2, sizeof(buffer) / sizeof(buffer[0]));
         int bufferLength = 0;
         if (m_littleEndian) {
             for (int i = 0; i < runLength; ++i) {
index a193a5d..3d5d7fd 100644 (file)
 
 namespace WebCore {
 
-const UniChar replacementCharacter = 0xFFFD;
-const UniChar BOM = 0xFEFF;
-
-static const int ConversionBufferSize = 16384;
-
 TextEncoding::TextEncoding(const char* name, bool eightBitOnly)
 {
     m_encodingID = textEncodingIDFromCharsetName(name, &m_flags);