<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[158499] trunk/Source</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/158499">158499</a></dd>
<dt>Author</dt> <dd>paroga@webkit.org</dd>
<dt>Date</dt> <dd>2013-11-02 14:47:46 -0700 (Sat, 02 Nov 2013)</dd>
</dl>

<h3>Log Message</h3>
<pre>Fix UnicodeWchar after <a href="http://trac.webkit.org/projects/webkit/changeset/157330">r157330</a>.
https://bugs.webkit.org/show_bug.cgi?id=123668

Reviewed by Darin Adler.

Source/WebCore:

* editing/TextIterator.cpp:
(WebCore::SearchBuffer::append):
* platform/graphics/wince/FontWinCE.cpp:
(WebCore::generateComponents):
* platform/graphics/wince/GraphicsContextWinCE.cpp:
(WebCore::GraphicsContext::drawText):
* platform/text/wchar/TextBreakIteratorWchar.cpp:
(WebCore::isCharStop):
(WebCore::isLineStop):
(WebCore::isSentenceStop):
(WebCore::WordBreakIterator::next):
(WebCore::WordBreakIterator::previous):

Source/WTF:

* wtf/unicode/wchar/UnicodeWchar.cpp:
(unorm_normalize):
(u_strFoldCase):
(u_strToLower):
(u_strToUpper):
* wtf/unicode/wchar/UnicodeWchar.h:
(u_foldCase):
(u_isprint):
(u_isspace):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWTFChangeLog">trunk/Source/WTF/ChangeLog</a></li>
<li><a href="#trunkSourceWTFwtfunicodewcharUnicodeWcharcpp">trunk/Source/WTF/wtf/unicode/wchar/UnicodeWchar.cpp</a></li>
<li><a href="#trunkSourceWTFwtfunicodewcharUnicodeWcharh">trunk/Source/WTF/wtf/unicode/wchar/UnicodeWchar.h</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreeditingTextIteratorcpp">trunk/Source/WebCore/editing/TextIterator.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicswinceFontWinCEcpp">trunk/Source/WebCore/platform/graphics/wince/FontWinCE.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicswinceGraphicsContextWinCEcpp">trunk/Source/WebCore/platform/graphics/wince/GraphicsContextWinCE.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformtextwcharTextBreakIteratorWcharcpp">trunk/Source/WebCore/platform/text/wchar/TextBreakIteratorWchar.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWTFChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/ChangeLog (158498 => 158499)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/ChangeLog        2013-11-02 21:18:59 UTC (rev 158498)
+++ trunk/Source/WTF/ChangeLog        2013-11-02 21:47:46 UTC (rev 158499)
</span><span class="lines">@@ -1,3 +1,20 @@
</span><ins>+2013-11-02  Patrick Gansterer  &lt;paroga@webkit.org&gt;
+
+        Fix UnicodeWchar after r157330.
+        https://bugs.webkit.org/show_bug.cgi?id=123668
+
+        Reviewed by Darin Adler.
+
+        * wtf/unicode/wchar/UnicodeWchar.cpp:
+        (unorm_normalize):
+        (u_strFoldCase):
+        (u_strToLower):
+        (u_strToUpper):
+        * wtf/unicode/wchar/UnicodeWchar.h:
+        (u_foldCase):
+        (u_isprint):
+        (u_isspace):
+
</ins><span class="cx"> 2013-11-02  Andreas Kling  &lt;akling@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Make remaining StringImpl functions return PassRef.
</span></span></pre></div>
<a id="trunkSourceWTFwtfunicodewcharUnicodeWcharcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/wtf/unicode/wchar/UnicodeWchar.cpp (158498 => 158499)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/wtf/unicode/wchar/UnicodeWchar.cpp        2013-11-02 21:18:59 UTC (rev 158498)
+++ trunk/Source/WTF/wtf/unicode/wchar/UnicodeWchar.cpp        2013-11-02 21:47:46 UTC (rev 158499)
</span><span class="lines">@@ -30,6 +30,7 @@
</span><span class="cx"> int unorm_normalize(const UChar*, int32_t, UNormalizationMode, int32_t, UChar*, int32_t, UErrorCode*)
</span><span class="cx"> {
</span><span class="cx">     ASSERT_NOT_REACHED();
</span><ins>+    return 0;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> UCharDirection u_charDirection(UChar32)
</span><span class="lines">@@ -82,7 +83,7 @@
</span><span class="cx">     return 0;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-template&lt;UChar Function(UChar)&gt;
</del><ins>+template&lt;wint_t Function(wint_t)&gt;
</ins><span class="cx"> static inline int convertWithFunction(UChar* result, int resultLength, const UChar* source, int sourceLength, UErrorCode&amp; status)
</span><span class="cx"> {
</span><span class="cx">     UChar* resultIterator = result;
</span><span class="lines">@@ -100,15 +101,15 @@
</span><span class="cx"> int u_strFoldCase(UChar* result, int resultLength, const UChar* source, int sourceLength, unsigned options, UErrorCode* status)
</span><span class="cx"> {
</span><span class="cx">     ASSERT_UNUSED(options, options == U_FOLD_CASE_DEFAULT);
</span><del>-    return convertWithFunction&lt;u_foldCase&gt;(result, resultLength, source, sourceLength, *status);
</del><ins>+    return convertWithFunction&lt;towlower&gt;(result, resultLength, source, sourceLength, *status);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> int u_strToLower(UChar* result, int resultLength, const UChar* source, int sourceLength, const char*, UErrorCode* status)
</span><span class="cx"> {
</span><del>-    return convertWithFunction&lt;u_tolower&gt;(result, resultLength, source, sourceLength, *status);
</del><ins>+    return convertWithFunction&lt;towlower&gt;(result, resultLength, source, sourceLength, *status);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> int u_strToUpper(UChar* result, int resultLength, const UChar* source, int sourceLength, const char*, UErrorCode* status)
</span><span class="cx"> {
</span><del>-    return convertWithFunction&lt;u_toupper&gt;(result, resultLength, source, sourceLength, *status);
</del><ins>+    return convertWithFunction&lt;towupper&gt;(result, resultLength, source, sourceLength, *status);
</ins><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWTFwtfunicodewcharUnicodeWcharh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/wtf/unicode/wchar/UnicodeWchar.h (158498 => 158499)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/wtf/unicode/wchar/UnicodeWchar.h        2013-11-02 21:18:59 UTC (rev 158498)
+++ trunk/Source/WTF/wtf/unicode/wchar/UnicodeWchar.h        2013-11-02 21:47:46 UTC (rev 158499)
</span><span class="lines">@@ -63,7 +63,7 @@
</span><span class="cx">     U_BOUNDARY_NEUTRAL
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-enum UDecompositionType { U_DT_NONE, U_DT_COMPAT, U_DT_FONT }
</del><ins>+enum UDecompositionType { U_DT_NONE, U_DT_COMPAT, U_DT_FONT };
</ins><span class="cx"> 
</span><span class="cx"> enum UErrorCode { U_ZERO_ERROR = 0, U_ERROR };
</span><span class="cx"> 
</span><span class="lines">@@ -79,6 +79,7 @@
</span><span class="cx"> // is implemented, that's not really worth the time.
</span><span class="cx"> 
</span><span class="cx"> #define U_GC_CC_MASK 0
</span><ins>+#define U_GC_CS_MASK 0
</ins><span class="cx"> #define U_GC_CF_MASK 0
</span><span class="cx"> #define U_GC_CN_MASK 0
</span><span class="cx"> #define U_GC_LL_MASK 0
</span><span class="lines">@@ -114,12 +115,14 @@
</span><span class="cx"> WTF_EXPORT_PRIVATE int unorm_normalize(const UChar* source, int32_t sourceLength, UNormalizationMode mode, int32_t options, UChar* result, int32_t resultLength, UErrorCode* status);
</span><span class="cx"> WTF_EXPORT_PRIVATE UCharDirection u_charDirection(UChar32);
</span><span class="cx"> WTF_EXPORT_PRIVATE UChar32 u_charMirror(UChar32);
</span><del>-WTF_EXPORT_PRIVATE UCharCategory u_charType(UChar32);
-inline UChar32 u_foldCase(UChar32 character, unsigned option) { ASSERT_UNUSED(options, options == U_FOLD_CASE_DEFAULT); return towlower(character); }
</del><ins>+WTF_EXPORT_PRIVATE int8_t u_charType(UChar32);
+inline UChar32 u_foldCase(UChar32 character, unsigned options) { ASSERT_UNUSED(options, options == U_FOLD_CASE_DEFAULT); return towlower(character); }
</ins><span class="cx"> WTF_EXPORT_PRIVATE uint8_t u_getCombiningClass(UChar32);
</span><span class="cx"> WTF_EXPORT_PRIVATE int u_getIntPropertyValue(UChar32, UProperty);
</span><span class="cx"> inline bool u_isalnum(UChar32 character) { return iswalnum(character); }
</span><ins>+inline bool u_isprint(UChar32 character) { return iswprint(character); }
</ins><span class="cx"> inline bool u_ispunct(UChar32 character) { return iswpunct(character); }
</span><ins>+inline bool u_isspace(UChar32 character) { return iswspace(character); }
</ins><span class="cx"> WTF_EXPORT_PRIVATE int u_memcasecmp(const UChar*, const UChar*, int sourceLength, unsigned options);
</span><span class="cx"> inline bool u_print(UChar32 character) { return iswprint(character); }
</span><span class="cx"> WTF_EXPORT_PRIVATE int u_strFoldCase(UChar* result, int resultLength, const UChar* source, int sourceLength, unsigned options, UErrorCode*);
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (158498 => 158499)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2013-11-02 21:18:59 UTC (rev 158498)
+++ trunk/Source/WebCore/ChangeLog        2013-11-02 21:47:46 UTC (rev 158499)
</span><span class="lines">@@ -1,3 +1,23 @@
</span><ins>+2013-11-02  Patrick Gansterer  &lt;paroga@webkit.org&gt;
+
+        Fix UnicodeWchar after r157330.
+        https://bugs.webkit.org/show_bug.cgi?id=123668
+
+        Reviewed by Darin Adler.
+
+        * editing/TextIterator.cpp:
+        (WebCore::SearchBuffer::append):
+        * platform/graphics/wince/FontWinCE.cpp:
+        (WebCore::generateComponents):
+        * platform/graphics/wince/GraphicsContextWinCE.cpp:
+        (WebCore::GraphicsContext::drawText):
+        * platform/text/wchar/TextBreakIteratorWchar.cpp:
+        (WebCore::isCharStop):
+        (WebCore::isLineStop):
+        (WebCore::isSentenceStop):
+        (WebCore::WordBreakIterator::next):
+        (WebCore::WordBreakIterator::previous):
+
</ins><span class="cx"> 2013-11-02  Andreas Kling  &lt;akling@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Use RenderChildIterator in a couple of places.
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingTextIteratorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/TextIterator.cpp (158498 => 158499)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/TextIterator.cpp        2013-11-02 21:18:59 UTC (rev 158498)
+++ trunk/Source/WebCore/editing/TextIterator.cpp        2013-11-02 21:47:46 UTC (rev 158499)
</span><span class="lines">@@ -2350,7 +2350,7 @@
</span><span class="cx">     ASSERT(U_SUCCESS(status));
</span><span class="cx">     ASSERT(numFoldedCharacters);
</span><span class="cx">     ASSERT(numFoldedCharacters &lt;= maxFoldedCharacters);
</span><del>-    if (!error &amp;&amp; numFoldedCharacters) {
</del><ins>+    if (U_SUCCESS(status) &amp;&amp; numFoldedCharacters) {
</ins><span class="cx">         numFoldedCharacters = std::min(numFoldedCharacters, maxFoldedCharacters);
</span><span class="cx">         append(foldedCharacters[0], true);
</span><span class="cx">         for (int i = 1; i &lt; numFoldedCharacters; ++i)
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicswinceFontWinCEcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/wince/FontWinCE.cpp (158498 => 158499)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/wince/FontWinCE.cpp        2013-11-02 21:18:59 UTC (rev 158498)
+++ trunk/Source/WebCore/platform/graphics/wince/FontWinCE.cpp        2013-11-02 21:47:46 UTC (rev 158499)
</span><span class="lines">@@ -140,7 +140,7 @@
</span><span class="cx">             UChar ch = run[i];
</span><span class="cx">             if (U16_IS_LEAD(ch) &amp;&amp; U16_IS_TRAIL(run[i-1]))
</span><span class="cx">                 ch = U16_GET_SUPPLEMENTARY(ch, run[i-1]);
</span><del>-            if (U16_IS_TRAIL(ch) || category(ch) == Mark_NonSpacing)
</del><ins>+            if (U16_IS_TRAIL(ch) || U_GET_GC_MASK(ch) &amp; U_GC_MN_MASK)
</ins><span class="cx">                 continue;
</span><span class="cx">             if (Font::treatAsSpace(run[i])) {
</span><span class="cx">                 int add = 0;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicswinceGraphicsContextWinCEcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/wince/GraphicsContextWinCE.cpp (158498 => 158499)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/wince/GraphicsContextWinCE.cpp        2013-11-02 21:18:59 UTC (rev 158498)
+++ trunk/Source/WebCore/platform/graphics/wince/GraphicsContextWinCE.cpp        2013-11-02 21:47:46 UTC (rev 158499)
</span><span class="lines">@@ -1623,7 +1623,7 @@
</span><span class="cx">                 offset += (*advance++).width();
</span><span class="cx">                 int offsetInt = stableRound(offset);
</span><span class="cx">                 if (isCharVisible(*srcChar)) {
</span><del>-                    if (!drawOneByOne &amp;&amp; WTF::Unicode::direction(*srcChar) == WTF::Unicode::RightToLeft)
</del><ins>+                    if (!drawOneByOne &amp;&amp; u_charDirection(*srcChar) == U_RIGHT_TO_LEFT)
</ins><span class="cx">                         drawOneByOne = true;
</span><span class="cx">                     *curChar++ = *srcChar;
</span><span class="cx">                     *curSpace++ = offsetInt - lastOffset;
</span><span class="lines">@@ -1635,7 +1635,7 @@
</span><span class="cx">                 offset += (*advance++).width() * scaleX;
</span><span class="cx">                 int offsetInt = stableRound(offset);
</span><span class="cx">                 if (isCharVisible(*srcChar)) {
</span><del>-                    if (!drawOneByOne &amp;&amp; WTF::Unicode::direction(*srcChar) == WTF::Unicode::RightToLeft)
</del><ins>+                    if (!drawOneByOne &amp;&amp; u_charDirection(*srcChar) == U_RIGHT_TO_LEFT)
</ins><span class="cx">                         drawOneByOne = true;
</span><span class="cx">                     *curChar++ = *srcChar;
</span><span class="cx">                     *curSpace++ = offsetInt - lastOffset;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformtextwcharTextBreakIteratorWcharcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/text/wchar/TextBreakIteratorWchar.cpp (158498 => 158499)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/text/wchar/TextBreakIteratorWchar.cpp        2013-11-02 21:18:59 UTC (rev 158498)
+++ trunk/Source/WebCore/platform/text/wchar/TextBreakIteratorWchar.cpp        2013-11-02 21:47:46 UTC (rev 158499)
</span><span class="lines">@@ -28,7 +28,6 @@
</span><span class="cx"> #include &lt;wtf/unicode/Unicode.h&gt;
</span><span class="cx"> 
</span><span class="cx"> using namespace WTF;
</span><del>-using namespace WTF::Unicode;
</del><span class="cx"> using namespace std;
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="lines">@@ -36,18 +35,18 @@
</span><span class="cx"> // Hack, not entirely correct
</span><span class="cx"> static inline bool isCharStop(UChar c)
</span><span class="cx"> {
</span><del>-    CharCategory charCategory = category(c);
-    return charCategory != Mark_NonSpacing &amp;&amp; (charCategory != Other_Surrogate || (c &lt; 0xd800 || c &gt;= 0xdc00));
</del><ins>+    int8_t charType = u_charType(c);
+    return U_MASK(charType) &amp; U_GC_MN_MASK || (U_MASK(charType) &amp; U_GC_CS_MASK &amp;&amp; (c &gt;= 0xd800 &amp;&amp; c &lt; 0xdc00));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static inline bool isLineStop(UChar c)
</span><span class="cx"> {
</span><del>-    return category(c) != Separator_Line;
</del><ins>+    return !(U_GET_GC_MASK(c) &amp; U_GC_ZL_MASK);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static inline bool isSentenceStop(UChar c)
</span><span class="cx"> {
</span><del>-    return isPunct(c);
</del><ins>+    return u_ispunct(c);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> class TextBreakIterator {
</span><span class="lines">@@ -114,9 +113,9 @@
</span><span class="cx">     }
</span><span class="cx">     bool haveSpace = false;
</span><span class="cx">     while (currentPos &lt; length) {
</span><del>-        if (haveSpace &amp;&amp; !isSpace(string[currentPos]))
</del><ins>+        if (haveSpace &amp;&amp; !u_isspace(string[currentPos]))
</ins><span class="cx">             break;
</span><del>-        if (isSpace(string[currentPos]))
</del><ins>+        if (u_isspace(string[currentPos]))
</ins><span class="cx">             haveSpace = true;
</span><span class="cx">         ++currentPos;
</span><span class="cx">     }
</span><span class="lines">@@ -131,9 +130,9 @@
</span><span class="cx">     }
</span><span class="cx">     bool haveSpace = false;
</span><span class="cx">     while (currentPos &gt; 0) {
</span><del>-        if (haveSpace &amp;&amp; !isSpace(string[currentPos]))
</del><ins>+        if (haveSpace &amp;&amp; !u_isspace(string[currentPos]))
</ins><span class="cx">             break;
</span><del>-        if (isSpace(string[currentPos]))
</del><ins>+        if (u_isspace(string[currentPos]))
</ins><span class="cx">             haveSpace = true;
</span><span class="cx">         --currentPos;
</span><span class="cx">     }
</span></span></pre>
</div>
</div>

</body>
</html>