emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] Allow inserting non-BMP characters


From: Philipp Stephani
Subject: Re: [PATCH] Allow inserting non-BMP characters
Date: Sun, 07 Jan 2018 15:51:55 +0000



Eli Zaretskii <address@hidden> schrieb am Fr., 29. Dez. 2017 um 21:27 Uhr:
> From: Philipp Stephani <address@hidden>
> Date: Fri, 29 Dec 2017 20:14:41 +0000
> Cc: address@hidden, address@hidden, address@hidden
>
> diff --git a/src/coding.c b/src/coding.c
> index 1705838ffa..9903d87b92 100644
> --- a/src/coding.c
> +++ b/src/coding.c
> @@ -1515,13 +1515,6 @@ encode_coding_utf_8 (struct coding_system *coding)
>  /* See the above "GENERAL NOTES on `detect_coding_XXX ()' functions".
>     Return true if a text is encoded in one of UTF-16 based coding systems.  */
>
> -#define UTF_16_HIGH_SURROGATE_P(val) \
> -  (((val) & 0xFC00) == 0xD800)
> -
> -#define UTF_16_LOW_SURROGATE_P(val) \
> -  (((val) & 0xFC00) == 0xDC00)
> -
> -
>  static bool
>  detect_coding_utf_16 (struct coding_system *coding,
>                     struct coding_detection_info *detect_info)
> @@ -1686,7 +1679,7 @@ decode_coding_utf_16 (struct coding_system *coding)
>
>        if (surrogate)
>       {
> -       if (! UTF_16_LOW_SURROGATE_P (c))
> +       if (! char_low_surrogate_p (c))

Please don't.  This makes decoding UTF-16 a tad slower for no good
reason (more than a tad in unoptimized builds).


OK, here's a new version of the patch. 

Attachment: 0001-Allow-inserting-non-BMP-characters.txt
Description: Text document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]