From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Philipp Stephani
> From: Philipp Stephani <p.stephani2@gmail.com>
> Date: Fri, 29 Dec 2017 20:14:41 +0000
> Cc: alan@idiocy.o= rg, phst@google.co= m, emacs-devel= @gnu.org
>
> 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 *codi= ng)
>=C2=A0 /* See the above "GENERAL NOTES on `detect_coding_XXX ()= 9; functions".
>=C2=A0 =C2=A0 =C2=A0Return true if a text is encoded in one of UTF-16 b= ased coding systems.=C2=A0 */
>
> -#define UTF_16_HIGH_SURROGATE_P(val) \
> -=C2=A0 (((val) & 0xFC00) =3D=3D 0xD800)
> -
> -#define UTF_16_LOW_SURROGATE_P(val) \
> -=C2=A0 (((val) & 0xFC00) =3D=3D 0xDC00)
> -
> -
>=C2=A0 static bool
>=C2=A0 detect_coding_utf_16 (struct coding_system *coding,
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0struct coding_detection_info *detect_info)
> @@ -1686,= 7 +1679,7 @@ decode_coding_utf_16 (struct coding_system *coding)
>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 if (surrogate)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0{
> -=C2=A0 =C2=A0 =C2=A0 =C2=A0if (! UTF_16_LOW_SURROGATE_P (c))
> +=C2=A0 =C2=A0 =C2=A0 =C2=A0if (! char_low_surrogate_p (c))
Please don't.=C2=A0 This makes decoding UTF-16 a tad slower for no good=
reason (more than a tad in unoptimized builds).