summaryrefslogtreecommitdiffstats
path: root/base/string_util.cc
diff options
context:
space:
mode:
authorhayato@chromium.org <hayato@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-25 04:23:02 +0000
committerhayato@chromium.org <hayato@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-25 04:23:02 +0000
commitd09ef157bb44612d1bcd1bfe4e5fa26e1aaf0408 (patch)
tree28c7cfef4167ffddce1fcd0ebacc4ab83b5b33c9 /base/string_util.cc
parent922dea0e0c86de952ae962127d3115234e277854 (diff)
downloadchromium_src-d09ef157bb44612d1bcd1bfe4e5fa26e1aaf0408.zip
chromium_src-d09ef157bb44612d1bcd1bfe4e5fa26e1aaf0408.tar.gz
chromium_src-d09ef157bb44612d1bcd1bfe4e5fa26e1aaf0408.tar.bz2
Ignore UTF-8's BOM when parsing userscript's metadata.
BUG=27333 TEST=UserScriptTest and check the issue does not happen against userscipt encoded in UTF-8 with BOM.. Review URL: http://codereview.chromium.org/420001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@33048 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/string_util.cc')
-rw-r--r--base/string_util.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/base/string_util.cc b/base/string_util.cc
index 5a45f27..01a6907 100644
--- a/base/string_util.cc
+++ b/base/string_util.cc
@@ -390,6 +390,8 @@ const char kWhitespaceASCII[] = {
0
};
+const char kUtf8ByteOrderMark[] = "\xEF\xBB\xBF";
+
template<typename STR>
TrimPositions TrimStringT(const STR& input,
const typename STR::value_type trim_chars[],