| 5345 | } |
| 5346 | |
| 5347 | String String::property_name_encode() const { |
| 5348 | const char32_t *cstr = get_data(); |
| 5349 | for (int i = 0; cstr[i]; i++) { |
| 5350 | if (cstr[i] == '=' || cstr[i] == '"' || cstr[i] == ';' || cstr[i] == '[' || cstr[i] == ']' || cstr[i] < 33 || cstr[i] > 126) { |
| 5351 | return "\"" + c_escape_multiline() + "\""; |
| 5352 | } |
| 5353 | } |
| 5354 | // Keep as is |
| 5355 | return *this; |
| 5356 | } |
| 5357 | |
| 5358 | /// Changes made to the set of invalid characters must also be reflected in the String documentation. |
| 5359 | static const char32_t invalid_node_name_characters[] = { '.', ':', '@', '/', '\"', UNIQUE_NODE_PREFIX[0], 0 }; |
no test coverage detected