diff options
| author | Philipp Stephani | 2017-12-25 22:00:00 +0100 |
|---|---|---|
| committer | Philipp Stephani | 2018-01-07 19:42:57 +0100 |
| commit | 703ac3ea1c1ce381f385469a0e88bc29d3fe83c2 (patch) | |
| tree | 1705907cf4ad37a8a3c40f094cbd0a751a4571c5 /src/coding.c | |
| parent | 95d0be0ae596b9f9f8b100576ca5d53a681e329c (diff) | |
| download | emacs-703ac3ea1c1ce381f385469a0e88bc29d3fe83c2.tar.gz emacs-703ac3ea1c1ce381f385469a0e88bc29d3fe83c2.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.
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 d8bc5250264..da625403441 100644 --- a/src/coding.c +++ b/src/coding.c | |||
| @@ -1515,13 +1515,6 @@ encode_coding_utf_8 (struct coding_system *coding) | |||
| 1515 | /* See the above "GENERAL NOTES on `detect_coding_XXX ()' functions". | 1515 | /* See the above "GENERAL NOTES on `detect_coding_XXX ()' functions". |
| 1516 | Return true if a text is encoded in one of UTF-16 based coding systems. */ | 1516 | Return true if a text is encoded in one of UTF-16 based coding systems. */ |
| 1517 | 1517 | ||
| 1518 | #define UTF_16_HIGH_SURROGATE_P(val) \ | ||
| 1519 | (((val) & 0xFC00) == 0xD800) | ||
| 1520 | |||
| 1521 | #define UTF_16_LOW_SURROGATE_P(val) \ | ||
| 1522 | (((val) & 0xFC00) == 0xDC00) | ||
| 1523 | |||
| 1524 | |||
| 1525 | static bool | 1518 | static bool |
| 1526 | detect_coding_utf_16 (struct coding_system *coding, | 1519 | detect_coding_utf_16 (struct coding_system *coding, |
| 1527 | struct coding_detection_info *detect_info) | 1520 | struct coding_detection_info *detect_info) |