utf8: teach same_encoding() alternative UTF encoding names
authorLars Schneider <redacted>
Sun, 15 Apr 2018 18:16:04 +0000 (20:16 +0200)
committerJunio C Hamano <redacted>
Mon, 16 Apr 2018 02:40:56 +0000 (11:40 +0900)
commit2f0c4a362c5db677ee392a6a550632bfb22d8319
treeae17d1999ec3d87d4f2f86337e6c5b6e59eb9ac6
parent66b8af3e124a0c9dbad05f40c2f6d27614f34349
utf8: teach same_encoding() alternative UTF encoding names

The function same_encoding() could only recognize alternative names for
UTF-8 encodings. Teach it to recognize all kinds of alternative UTF
encoding names (e.g. utf16).

While we are at it, fix a crash that would occur if same_encoding() was
called with a NULL argument and a non-NULL argument.

This function is used in a subsequent commit.

Signed-off-by: Lars Schneider <redacted>
Signed-off-by: Junio C Hamano <redacted>
utf8.c
git clone https://git.99rst.org/PROJECT