mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-27 05:32:45 +00:00
DEVTOOLS: COMPANION, COMMON: Add DEL character to be punycoded
This commit is contained in:
parent
34faf7f6ea
commit
fa3e3025bf
@ -58,7 +58,7 @@ namespace Common {
|
||||
#define INITIAL_BIAS 72
|
||||
#define SMAX 2147483647 // maximum Unicode code point
|
||||
|
||||
#define SPECIAL_SYMBOLS "/\":*|\\?%<>"
|
||||
#define SPECIAL_SYMBOLS "/\":*|\\?%<>\x7f"
|
||||
|
||||
static uint32 adapt_bias(uint32 delta, unsigned n_points, int is_first) {
|
||||
uint32 k;
|
||||
|
@ -203,7 +203,7 @@ def escape_string(s: str) -> str:
|
||||
for char in s:
|
||||
if char == "\x81":
|
||||
new_name += "\x81\x79"
|
||||
elif char in '/":*|\\?%<>' or ord(char) < 0x20:
|
||||
elif char in '/":*|\\?%<>\x7f' or ord(char) < 0x20:
|
||||
new_name += "\x81" + chr(0x80 + ord(char))
|
||||
else:
|
||||
new_name += char
|
||||
@ -689,6 +689,7 @@ def test_decode_name():
|
||||
],
|
||||
["Buried in Timeェ Demo", "xn--Buried in Time Demo-yp97h"],
|
||||
["ぱそすけPPC", "xn--PPC-873bpbxa3l"],
|
||||
["Madeline Pre-K\x7f Demo", "xn--Madeline Pre-K Demo-8a06x"],
|
||||
]
|
||||
for input, output in checks:
|
||||
assert punyencode(input) == output
|
||||
|
Loading…
x
Reference in New Issue
Block a user