aboutsummaryrefslogtreecommitdiff
path: root/core/ustring.cpp
diff options
context:
space:
mode:
authorAlexander Holland2016-05-05 13:34:15 +0200
committerAlexander Holland2016-05-05 13:34:15 +0200
commitf86cffd8e6cacb09cf59c27423c7e82c0e024aaa (patch)
treea18626307d30d307bcbee44ce33e953347f07ccb /core/ustring.cpp
parent9487a9b3c25f23942561eba20edce24f4be6f148 (diff)
downloadgodot-f86cffd8e6cacb09cf59c27423c7e82c0e024aaa.tar.gz
godot-f86cffd8e6cacb09cf59c27423c7e82c0e024aaa.tar.zst
godot-f86cffd8e6cacb09cf59c27423c7e82c0e024aaa.zip
Diffstat (limited to 'core/ustring.cpp')
-rw-r--r--core/ustring.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/core/ustring.cpp b/core/ustring.cpp
index 573c36238..730f7cfa3 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')