|
From: | Nayana Hettiarachchi |
Subject: | Re: [bug-gnu-libiconv] iconv fails to convert utf8 with bom to cp1251 |
Date: | Fri, 8 Dec 2017 07:26:14 +0700 |
Hi,
> > iconv SHOULD not allow a BOM in this conversion
>
> Should doesn't mean must. Anyway I didn't provide any input encoding,
> only output.
iconv always takes an input encoding. If you didn't specify an explicit
encoding, you implicitly specified the locale's encoding, which under
Linux nowadays most likely is UTF-8.
> So how to escape this problem? I see two options: add another encoding
> called utf8-bom or ignore bom character.
Once you know that the file is in UTF-8+BOM encoding, you need to
strip off the BOM:
$ tail --bytes=+4 < FILE | iconv -f UTF-8 -t ...
Bruno
_______________________________________________
bug-gnu-libiconv mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/bug-gnu-libiconv
[Prev in Thread] | Current Thread | [Next in Thread] |