utf8: teach same_encoding() alternative UTF encoding names
commit2f0c4a362c5db677ee392a6a550632bfb22d8319
authorLars Schneider <larsxschneider@gmail.com>
Sun, 15 Apr 2018 18:16:04 +0000 (15 20:16 +0200)
committerJunio C Hamano <gitster@pobox.com>
Mon, 16 Apr 2018 02:40:56 +0000 (16 11:40 +0900)
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 <larsxschneider@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
utf8.c