public inbox for libc-locales@sourceware.org
 help / color / mirror / Atom feed
From: Florian Weimer <fweimer@redhat.com>
To: Lokesh Janghel via Libc-alpha <libc-alpha@sourceware.org>
Cc: libc-locales@sourceware.org,
	 Lokesh Janghel <lokeshjanghel91@gmail.com>,
	 Umesh Kalappa <umesh.kalappa0@gmail.com>
Subject: Re: iconv: illegal input sequence
Date: Wed, 10 Mar 2021 10:20:13 +0100	[thread overview]
Message-ID: <87ft13uzzm.fsf@oldenburg.str.redhat.com> (raw)
In-Reply-To: <CACcU4_q=YncX9=GuuLnHsaRLzEqcypBUVsQrmdBaYB0ybRjmUg@mail.gmail.com> (Lokesh Janghel via Libc-alpha's message of "Wed, 10 Mar 2021 14:39:27 +0530")

* 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


  reply	other threads:[~2021-03-10  9:20 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 [this message]
2021-03-30  5:22   ` Lokesh Janghel
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=87ft13uzzm.fsf@oldenburg.str.redhat.com \
    --to=fweimer@redhat.com \
    --cc=libc-alpha@sourceware.org \
    --cc=libc-locales@sourceware.org \
    --cc=lokeshjanghel91@gmail.com \
    --cc=umesh.kalappa0@gmail.com \
    /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).