[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: fscanf and special characters
From: |
CdeMills |
Subject: |
Re: fscanf and special characters |
Date: |
Tue, 22 Jun 2010 08:54:43 -0700 (PDT) |
David Grundberg-3 wrote:
>
> On 06/22/2010 09:41 AM, CdeMills wrote:
>>
>> Hello,
>>
>> while reading a file with in = fscanf(fid, "%c");
>>
>> I got the warning message "range error for conversion to character
>> value",
>> because the file starts with, in hex, "0xEF 0xEB 0xBF" whose ascii names
>> are
>
> Aren't those bytes the UTF-16 endian magic code? Try converting the
> file to UTF-8 using iconv.
>
>
It is indeed the BOM (Byte Order Mark), see
http://unicode.org/faq/utf_bom.html, see question "When a BOM is used, is it
only in 16-bit Unicode text?" for a list of encoding markers. I missquoted
the beginning string, it was EF BB BF, which is the UTF-8 BOM
Regards
Pascal
--
View this message in context:
http://octave.1599824.n4.nabble.com/fscanf-and-special-characters-tp2263736p2264335.html
Sent from the Octave - General mailing list archive at Nabble.com.