bug-gnu-libiconv
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [bug-gnu-libiconv] iconv fails to convert utf8 with bom to cp1251


From: Nayana Hettiarachchi
Subject: Re: [bug-gnu-libiconv] iconv fails to convert utf8 with bom to cp1251
Date: Fri, 8 Dec 2017 20:45:07 +0700

for the record, if your making an open source offering, it becomes a community service, but if you have problems dealing with people. just don't make it open source because you just want to get the benifit iof a show off, there will be a time the average egineer will become as smart as you think you are and that ego of yours will become powerless. good luck brother. 

On Fri, Dec 8, 2017 at 7:26 AM, Nayana Hettiarachchi <address@hidden> wrote:
in all fairness a less almighty and simple vconi is almost done. much simpler interface. no hacks. and a friendly guy to talk to soon on a computer near you. 

On Dec 8, 2017 06:25, "Bruno Haible" <address@hidden> wrote:
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


reply via email to

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