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: Eli Zaretskii
Subject: Re: [PATCH] Allow inserting non-BMP characters
Date: Fri, 29 Dec 2017 22:27:09 +0200

> 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).

(Why can't you just accept what I'm saying?  Don't my position and my
experience mean anything to you?)



reply via email to

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