summaryrefslogtreecommitdiff
path: root/chromium/net/base/escape.h
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/net/base/escape.h')
-rw-r--r--chromium/net/base/escape.h18
1 files changed, 9 insertions, 9 deletions
diff --git a/chromium/net/base/escape.h b/chromium/net/base/escape.h
index 5d494045d22..af4edf0f790 100644
--- a/chromium/net/base/escape.h
+++ b/chromium/net/base/escape.h
@@ -81,7 +81,8 @@ class UnescapeRule {
// Convert %20 to spaces. In some places where we're showing URLs, we may
// want this. In places where the URL may be copied and pasted out, then
// you wouldn't want this since it might not be interpreted in one piece
- // by other applications.
+ // by other applications. Other unicode spaces will not be unescaped unless
+ // SPOOFING_AND_CONTROL_CHARS is used.
SPACES = 1 << 1,
// Unescapes '/' and '\\'. If these characters were unescaped, the resulting
@@ -116,17 +117,16 @@ class UnescapeRule {
// Unescapes |escaped_text| and returns the result.
// Unescaping consists of looking for the exact pattern "%XX", where each X is
// a hex digit, and converting to the character with the numerical value of
-// those digits. Thus "i%20=%203%3b" unescapes to "i = 3;".
+// those digits. Thus "i%20=%203%3b" unescapes to "i = 3;", if the
+// "UnescapeRule::SPACES" used.
//
-// Watch out: this doesn't necessarily result in the correct final result,
-// because the encoding may be unknown. For example, the input might be ASCII,
-// which, after unescaping, is supposed to be interpreted as UTF-8, and then
-// converted into full UTF-16 chars. This function won't tell you if any
-// conversions need to take place, it only unescapes.
+// This method does not ensure that the output is a valid string using any
+// character encoding. However, unless SPOOFING_AND_CONTROL_CHARS is set, it
+// does leave escaped certain byte sequences that would be dangerous to display
+// to the user, because if interpreted as UTF-8, they could be used to mislead
+// the user.
NET_EXPORT std::string UnescapeURLComponent(base::StringPiece escaped_text,
UnescapeRule::Type rules);
-NET_EXPORT base::string16 UnescapeURLComponent(base::StringPiece16 escaped_text,
- UnescapeRule::Type rules);
// Unescapes the given substring as a URL, and then tries to interpret the
// result as being encoded as UTF-8. If the result is convertable into UTF-8, it