Re: iconv - how to ignore BOM
- From: "howa" <howachen@xxxxxxxxx>
- Date: 24 Jan 2006 08:23:17 -0800
yes, uconv can strip off the BOM automatically by using command line
option
http://www.jeffhung.idv.tw/cgi-bin/man2web?program=uconv§ion=1
but i don't know if there are some options which i can set by using
iconv
seems if iconv cannot convert UTF-8 to Big-5 or other encoding due to
the BOM, a little bit funny...
Laurenz Albe 寫道:
> howachen@xxxxxxxxx wrote:
> > How to convert a UTF-16LE file to UTF-8, without the BOM
> >
> > e.g. iconv -f UTF-16LE -t UTF-8 -o output.txt input.txt
> >
> > this above command will output UTF-8 file with BOM
> >
> > since if I use this UTF-8 with BOM file and futher convert into another
> > encoding, such as BIG-5
> >
> > error will be returned as : illegal input sequence at position 0
>
> The resulting UTF-8 file will only contain a BOM if the input file
> contains a BOM. This character is just translated from UTF-16 to UTF-8.
>
> You will either need to cut the first 2 bytes from the input file before
> converting or cut the first 3 bytes from the result file (this is the
> BOM in both cases).
>
> I can't think of a UNIX utility that will do such a task well, maybe
> someone else can help.
> You could also write a very simple C program that just outputs its
> standard input except the first 2 or 3 bytes.
>
> Yours,
> Laurenz Albe
.
- Follow-Ups:
- Re: iconv - how to ignore BOM
- From: Laurenz Albe
- Re: iconv - how to ignore BOM
- References:
- iconv - how to ignore BOM
- From: howachen
- Re: iconv - how to ignore BOM
- From: Laurenz Albe
- iconv - how to ignore BOM
- Prev by Date: Re: A CD image viewer and extractor?
- Next by Date: Re: A CD image viewer and extractor?
- Previous by thread: Re: iconv - how to ignore BOM
- Next by thread: Re: iconv - how to ignore BOM
- Index(es):
Relevant Pages
|