From: Lokesh Janghel <lokeshjanghel91@gmail.com>
To: Florian Weimer <fweimer@redhat.com>
Cc: Lokesh Janghel via Libc-alpha <libc-alpha@sourceware.org>,
libc-locales@sourceware.org
Subject: Re: iconv: illegal input sequence
Date: Tue, 30 Mar 2021 10:52:40 +0530 [thread overview]
Message-ID: <CACcU4_qKNTFHTSBC8HWV=mVnqdj5XyFp_YPXZf-bJ76+iximQQ@mail.gmail.com> (raw)
In-Reply-To: <87ft13uzzm.fsf@oldenburg.str.redhat.com>
Hi,
As my file is the Shift_JIS format:
...
$ nkf --guess test_sjis.cxx
Shift_JIS (LF)
...
And got the following problem with gcc-8.3:
$./cc1plus -E test_sjis.cxx -finput-charset=cp932
cc1plus: error: conversion from cp932 to UTF-8 not supported by iconv
Can you share your knowledge if I am following the wrong conversion?
Please let me know your thoughts on the problem.
Thanks,
Lokesh
On Wed, Mar 10, 2021 at 2:50 PM Florian Weimer <fweimer@redhat.com> wrote:
>
> * Lokesh Janghel via Libc-alpha:
>
> > And I am facing error like "iconv: illegal input sequence at position 85"
> > When I try to convert with:
> > $iconv -f cp932 -t utf8 test.cxx
>
> Apparently, this is your input file:
>
> 00000000: 2369 6620 300a 2369 6e63 6c75 6465 203c #if 0.#include <
> 00000010: 7678 576f 726b 732e 683e 0a23 696e 636c vxWorks.h>.#incl
> 00000020: 7564 6520 3c73 7464 696f 2e68 3e0a 2365 ude <stdio.h>.#e
> 00000030: 6e64 6966 0a0a 766f 6964 2074 6573 745f ndif..void test_
> 00000040: 736a 6973 2829 0a7b 0a20 2020 2070 7269 sjis().{. pri
> 00000050: 6e74 6628 22ef bfbd efbf bdef bfbd efbf ntf("...........
> 00000060: bdef bfbd 5368 6966 742d 4a49 53ef bfbd ....Shift-JIS...
> 00000070: cc83 65ef bfbd 58ef bfbd 67ef bfbd c582 ..e...X...g.....
> 00000080: efbf bdef bfbd 425c 6e22 293b 0a7d ......B\n");.}
>
> The byte sequence at offset 85 is 0xef 0xbf 0xbd. That doesn't look
> like CP932, but UTF-8. It looks like your input file already underwent
> UTF-8 conversion at some point.
>
> Thanks,
> Florian
>
next prev parent reply other threads:[~2021-03-30 5:22 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-10 9:09 Lokesh Janghel
2021-03-10 9:20 ` Florian Weimer
2021-03-30 5:22 ` Lokesh Janghel [this message]
2021-03-30 5:46 ` Florian Weimer
2021-03-30 6:30 ` Lokesh Janghel
2021-03-30 8:22 ` Andreas Schwab
2021-03-31 13:02 ` Lokesh Janghel
2021-03-31 13:12 ` Andreas Schwab
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CACcU4_qKNTFHTSBC8HWV=mVnqdj5XyFp_YPXZf-bJ76+iximQQ@mail.gmail.com' \
--to=lokeshjanghel91@gmail.com \
--cc=fweimer@redhat.com \
--cc=libc-alpha@sourceware.org \
--cc=libc-locales@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).