diff options
| author | Philipp Stephani | 2017-12-25 22:00:00 +0100 |
|---|---|---|
| committer | Alan Third | 2018-06-17 11:50:58 +0100 |
| commit | 0deab3fbd8a51fc83ab7c8031f4e296a4003b055 (patch) | |
| tree | c6df46e597238d00b5cee8157e4f76be36d9999d /src/coding.c | |
| parent | ebe065fddf76fde64a9c07b419b67fe47fb6c1cb (diff) | |
| download | emacs-0deab3fbd8a51fc83ab7c8031f4e296a4003b055.tar.gz emacs-0deab3fbd8a51fc83ab7c8031f4e296a4003b055.zip | |
Allow inserting non-BMP characters
* src/coding.h (UTF_16_HIGH_SURROGATE_P, UTF_16_LOW_SURROGATE_P): Move
from coding.c and document.
(surrogates_to_codepoint): New function.
* src/nsterm.m (insertText:): Properly handle surrogate pairs.
(cherry picked from commit 703ac3ea1c1ce381f385469a0e88bc29d3fe83c2)
Diffstat (limited to 'src/coding.c')
| -rw-r--r-- | src/coding.c | 7 |
1 files changed, 0 insertions, 7 deletions
diff --git a/src/coding.c b/src/coding.c index b1eb2edb497..867f84de609 100644 --- a/src/coding.c +++ b/src/coding.c | |||
| @@ -1518,13 +1518,6 @@ encode_coding_utf_8 (struct coding_system *coding) | |||
| 1518 | /* See the above "GENERAL NOTES on `detect_coding_XXX ()' functions". | 1518 | /* See the above "GENERAL NOTES on `detect_coding_XXX ()' functions". |
| 1519 | Return true if a text is encoded in one of UTF-16 based coding systems. */ | 1519 | Return true if a text is encoded in one of UTF-16 based coding systems. */ |
| 1520 | 1520 | ||
| 1521 | #define UTF_16_HIGH_SURROGATE_P(val) \ | ||
| 1522 | (((val) & 0xFC00) == 0xD800) | ||
| 1523 | |||
| 1524 | #define UTF_16_LOW_SURROGATE_P(val) \ | ||
| 1525 | (((val) & 0xFC00) == 0xDC00) | ||
| 1526 | |||
| 1527 | |||
| 1528 | static bool | 1521 | static bool |
| 1529 | detect_coding_utf_16 (struct coding_system *coding, | 1522 | detect_coding_utf_16 (struct coding_system *coding, |
| 1530 | struct coding_detection_info *detect_info) | 1523 | struct coding_detection_info *detect_info) |