From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by sourceware.org (Postfix) with ESMTP id 598D53858001 for ; Wed, 10 Mar 2021 09:20:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 598D53858001 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-526-lZd-UZ58PwewcKyw3x8tfQ-1; Wed, 10 Mar 2021 04:20:08 -0500 X-MC-Unique: lZd-UZ58PwewcKyw3x8tfQ-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 0D167881D5F; Wed, 10 Mar 2021 09:20:07 +0000 (UTC) Received: from oldenburg.str.redhat.com (ovpn-112-77.ams2.redhat.com [10.36.112.77]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D876A5D746; Wed, 10 Mar 2021 09:20:05 +0000 (UTC) From: Florian Weimer To: Lokesh Janghel via Libc-alpha Cc: libc-locales@sourceware.org, Lokesh Janghel , Umesh Kalappa Subject: Re: iconv: illegal input sequence References: Date: Wed, 10 Mar 2021 10:20:13 +0100 In-Reply-To: (Lokesh Janghel via Libc-alpha's message of "Wed, 10 Mar 2021 14:39:27 +0530") Message-ID: <87ft13uzzm.fsf@oldenburg.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=unavailable autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-locales@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-locales mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Mar 2021 09:20:13 -0000 * 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 .#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