Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(133)

Unified Diff: googleurl/src/url_canon_internal.h

Issue 160589: All host names with nonascii characters (cyrillic) + escapable characters (,)... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « googleurl/src/url_canon_host.cc ('k') | googleurl/src/url_canon_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: googleurl/src/url_canon_internal.h
===================================================================
--- googleurl/src/url_canon_internal.h (revision 110)
+++ googleurl/src/url_canon_internal.h (working copy)
@@ -143,8 +143,11 @@
// Write a single character, escaped, to the output. This always escapes: it
// does no checking that thee character requires escaping.
-inline void AppendEscapedChar(unsigned char ch,
- CanonOutput* output) {
+// Escaping makes sense only 8 bit chars, so code works in all cases of
+// input parameters (8/16bit).
+template<typename UINCHAR, typename OUTCHAR>
+inline void AppendEscapedChar(UINCHAR ch,
+ CanonOutputT<OUTCHAR>* output) {
output->push_back('%');
output->push_back(kHexCharLookup[ch >> 4]);
output->push_back(kHexCharLookup[ch & 0xf]);
« no previous file with comments | « googleurl/src/url_canon_host.cc ('k') | googleurl/src/url_canon_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698