Changeset 128684 in webkit


Ignore:
Timestamp:
Sep 15, 2012 12:01:47 AM (12 years ago)
Author:
mrowe@apple.com
Message:

Roll out r128682 since it broke the Mac release builds.

Location:
trunk/Source/WTF
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WTF/ChangeLog

    r128682 r128684  
    1 2012-09-14  Glenn Adams  <glenn@skynav.com>
    2 
    3         WTFString::show doesn't dump non-ASCII characters in a readable manner
    4         https://bugs.webkit.org/show_bug.cgi?id=96749
    5 
    6         Reviewed by Benjamin Poulain.
    7 
    8         Dump non-ASCII characters in a useful form for debugging.
    9 
    10         * wtf/text/WTFString.cpp:
    11         (asciiDebug):
    12         Dump non-ASCII characters (i.e., UTF-16 code elements) as well as non-printable ASCII characters
    13         using \uXXXX format.
    14 
    1512012-09-14  Alexey Proskuryakov  <ap@apple.com>
    162
  • trunk/Source/WTF/wtf/text/WTFString.cpp

    r128682 r128684  
    2727#include <wtf/ASCIICType.h>
    2828#include <wtf/DataLog.h>
    29 #include <wtf/HexNumber.h>
    3029#include <wtf/MathExtras.h>
    3130#include <wtf/MemoryInstrumentation.h>
     
    11371136
    11381137    Vector<char> buffer;
    1139     for (unsigned i = 0; i < impl->length(); ++i) {
    1140         UChar ch = (*impl)[i];
    1141         if (isASCIIPrintable(ch))
    1142             buffer.append(ch);
    1143         else {
    1144             buffer.append('\\');
    1145             buffer.append('u');
    1146             appendUnsignedAsHexFixedSize(ch, buffer, 4);
    1147         }
    1148     }
    1149     buffer.append('\0');
     1138    unsigned length = impl->length();
     1139    const UChar* characters = impl->characters();
     1140
     1141    buffer.resize(length + 1);
     1142    for (unsigned i = 0; i < length; ++i) {
     1143        UChar ch = characters[i];
     1144        buffer[i] = ch && (ch < 0x20 || ch > 0x7f) ? '?' : ch;
     1145    }
     1146    buffer[length] = '\0';
     1147
    11501148    return buffer;
    11511149}
Note: See TracChangeset for help on using the changeset viewer.