Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.

Commit f2513dc

Browse files
committed
[[ LCB ]] Replace overlong unicode escapes with U+FFFD.
1 parent 626000e commit f2513dc

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

docs/specs/livecode_builder_language_reference.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Strings use backslash ('\') as an escape - the following are understood:
3030
- **\r**: CR (ASCII 13)
3131
- **\t**: TAB (ASCII 9)
3232
- **\q**: quote '"'
33-
- **\u{XX}: character with unicode codepoint hex value 0xX...X - any number of nibbles may be specified, but the value will be clamped to 0x10FFFF.
33+
- **\u{X...X}: character with unicode codepoint U+X...X - any number of nibbles may be specified, but any values greater than 0x10FFFF will be replaced by U+FFFD.
3434
- **\\**: backslash '\'
3535

3636
> **Note:** The presence of '.' in identifiers are used as a namespace scope delimiter.

toolchain/lc-compile/src/literal.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ int UnescapeStringLiteral(long p_position, const char *p_string, long *r_unescap
208208
if (t_overflow)
209209
{
210210
Warning_UnicodeEscapeTooBig(p_position + (t_escape - p_string));
211-
t_char = 0x10FFFF;
211+
t_char = 0xFFFD;
212212
}
213213

214214
append_utf8_char(t_value, &t_length, t_char);

toolchain/lc-compile/src/report.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ DEFINE_ERROR(NonHandlerTypeVariablesCannotBeCalled, "Variables must have handler
186186

187187
DEFINE_WARNING(MetadataClausesShouldComeAfterUseClauses, "Metadata clauses should come after use clauses")
188188
DEFINE_WARNING(EmptyUnicodeEscape, "Unicode escape sequence specified with no nibbles")
189-
DEFINE_WARNING(UnicodeEscapeTooBig, "Unicode escape sequence too big, character clamped to \\u{10FFFF}");
189+
DEFINE_WARNING(UnicodeEscapeTooBig, "Unicode escape sequence too big, replaced with U+FFFD");
190190

191191
////////////////////////////////////////////////////////////////////////////////
192192

0 commit comments

Comments
 (0)