MCPcopy Create free account
hub / github.com/Redot-Engine/redot-engine / uri_encode

Method uri_encode

core/string/ustring.cpp:4650–4666  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4648}
4649
4650String String::uri_encode() const {
4651 const CharString temp = utf8();
4652 String res;
4653
4654 for (int i = 0; i < temp.length(); ++i) {
4655 uint8_t ord = uint8_t(temp[i]);
4656 if (ord == '.' || ord == '-' || ord == '~' || is_ascii_identifier_char(ord)) {
4657 res += ord;
4658 } else {
4659 char p[4] = { '%', 0, 0, 0 };
4660 p[1] = hex_char_table_upper[ord >> 4];
4661 p[2] = hex_char_table_upper[ord & 0xF];
4662 res += p;
4663 }
4664 }
4665 return res;
4666}
4667
4668String String::uri_decode() const {
4669 CharString src = utf8();

Callers 8

_serialize_imageMethod · 0.80
get_file_uriMethod · 0.80
add_stack_variableMethod · 0.80
_select_authorMethod · 0.80
_searchMethod · 0.80
move_to_trashMethod · 0.80
test_string.hFile · 0.80

Calls 2

is_ascii_identifier_charFunction · 0.85
lengthMethod · 0.45

Tested by 1

add_stack_variableMethod · 0.64