mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Mangling: support for special encoding ASCII of characters which may not appear in symbol names.
Such characters (like ‘.’) can be punycode-encoded just like non-ASCII unicode characters.
This commit is contained in:
@@ -47,7 +47,9 @@ static int digit_index(char value) {
|
||||
}
|
||||
|
||||
static bool isValidUnicodeScalar(uint32_t S) {
|
||||
return (S < 0xD800) || (S >= 0xE000 && S <= 0x1FFFFF);
|
||||
// Also accept the range of 0xD800 - 0xD880, which is used for non-symbol
|
||||
// ASCII characters.
|
||||
return (S < 0xD880) || (S >= 0xE000 && S <= 0x1FFFFF);
|
||||
}
|
||||
|
||||
// Section 6.1: Bias adaptation function
|
||||
@@ -200,6 +202,8 @@ static bool encodeToUTF8(const std::vector<uint32_t> &Scalars,
|
||||
OutUTF8.clear();
|
||||
return false;
|
||||
}
|
||||
if (S >= 0xD800 && S < 0xD880)
|
||||
S -= 0xD800;
|
||||
|
||||
unsigned Bytes = 0;
|
||||
if (S < 0x80)
|
||||
|
||||
Reference in New Issue
Block a user