Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: compiled/filter/Filter.cpp

Issue 29721753: Issue 6180 - use ABP_TEXT everywhere in order to let String be a UTF-8 string (Closed) Base URL: https://github.com/adblockplus/adblockpluscore.git@adb2678354813ce5b6de095072954c5a784a7bc4
Patch Set: rebase Created March 15, 2018, 1:53 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « compiled/filter/ElemHideBase.cpp ('k') | compiled/filter/RegExpFilter.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: compiled/filter/Filter.cpp
diff --git a/compiled/filter/Filter.cpp b/compiled/filter/Filter.cpp
index 9154377674d4bbcbe60400341274c03060706dd6..8184258186857618a32e4ea294aa95a726627201 100644
--- a/compiled/filter/Filter.cpp
+++ b/compiled/filter/Filter.cpp
@@ -40,13 +40,13 @@ namespace
// Remove leading spaces and special characters like line breaks
for (; start < end; start++)
- if (text[start] > ' ')
+ if (text[start] > ABP_TEXT(' '))
break;
// Now look for invalid characters inside the string
String::size_type pos;
for (pos = start; pos < end; pos++)
- if (text[pos] < ' ')
+ if (text[pos] < ABP_TEXT(' '))
break;
if (pos < end)
@@ -56,7 +56,7 @@ namespace
String::size_type delta = 1;
for (pos = pos + 1; pos < end; pos++)
{
- if (text[pos] < ' ')
+ if (text[pos] < ABP_TEXT(' '))
delta++;
else
text[pos - delta] = text[pos];
@@ -66,7 +66,7 @@ namespace
// Remove trailing spaces
for (; end > 0; end--)
- if (text[end - 1] != ' ')
+ if (text[end - 1] != ABP_TEXT(' '))
break;
// Set new string boundaries
@@ -87,9 +87,9 @@ Filter::~Filter()
OwnedString Filter::Serialize() const
{
- OwnedString result(u"[Filter]\ntext="_str);
+ OwnedString result(ABP_TEXT("[Filter]\ntext="_str));
result.append(mText);
- result.append(u'\n');
+ result.append(ABP_TEXT('\n'));
return result;
}
@@ -153,7 +153,7 @@ Filter* Filter::FromText(DependentString& text)
case ElemHideEmulationFilter::classType:
filter = FilterPtr(new ElemHideEmulationFilter(text, data.elemhide), false);
if (static_cast<ElemHideEmulationFilter*>(filter.get())->IsGeneric())
- filter = FilterPtr(new InvalidFilter(text, u"filter_elemhideemulation_nodomain"_str), false);
+ filter = FilterPtr(new InvalidFilter(text, ABP_TEXT("filter_elemhideemulation_nodomain"_str)), false);
break;
default:
// This should never happen but just in case
« no previous file with comments | « compiled/filter/ElemHideBase.cpp ('k') | compiled/filter/RegExpFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld