summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorRémi Verschelde <remi@verschelde.fr>2016-05-07 20:19:32 +0200
committerRémi Verschelde <remi@verschelde.fr>2016-05-07 20:19:32 +0200
commit21a71e8b7c6d518aaa444dd559e286dceaeaf1bd (patch)
tree9bf3af86a9d3fd978d7d845a6b4b647ac1b3fb77 /core
parentd5c11091e7987dbbb5dbde8060a4853c1e511296 (diff)
parentf86cffd8e6cacb09cf59c27423c7e82c0e024aaa (diff)
Merge pull request #4553 from AlexHolly/fix-percent-decode-utf8
fix percent decode utf8 error
Diffstat (limited to 'core')
-rw-r--r--core/ustring.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/core/ustring.cpp b/core/ustring.cpp
index 573c362389..730f7cfa3b 100644
--- a/core/ustring.cpp
+++ b/core/ustring.cpp
@@ -3629,13 +3629,14 @@ String String::percent_decode() const {
CharString pe;
- for(int i=0;i<length();i++) {
-
- uint8_t c=operator[](i);
+ CharString cs = utf8();
+ for(int i=0;i<cs.length();i++) {
+
+ uint8_t c = cs[i];
if (c=='%' && i<length()-2) {
- uint8_t a = LOWERCASE(operator[](i+1));
- uint8_t b = LOWERCASE(operator[](i+2));
+ uint8_t a = LOWERCASE(cs[i+1]);
+ uint8_t b = LOWERCASE(cs[i+2]);
c=0;
if (a>='0' && a<='9')