From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-yb1-xb35.google.com (mail-yb1-xb35.google.com [IPv6:2607:f8b0:4864:20::b35]) by sourceware.org (Postfix) with ESMTPS id 792453858002; Tue, 30 Mar 2021 05:22:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 792453858002 Received: by mail-yb1-xb35.google.com with SMTP id v107so11139126ybi.9; Mon, 29 Mar 2021 22:22:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=tjLtE0kIeMVCpG0tQP1uqLZjwGYoEnwaw78QQqHAEeg=; b=ikfCx0yqnUpKJ7uthHo6YMn75Fp9ZfkClMB9Quliwe39aW8zr1tzwIZBZYHM4vKMIm DBSoY/TXb5DZRhXz+58qQ83sEpP+SeuJul+CGElBPspMBMobjxpidiUigWW/fNqrNYjr QFKvMSbuT123gG0h874Y4utSDnb+8nwrMdOM+LV234JEug3wZ6StnurbctNfqOMv7FmG amaoA7cuKTAeQUg9SvR2HiUqP2iIjRMpC+zQVVeZSWvNC1ecljKvq5h+wFVg++snCu2o lD6GkGCM/2txFzhjMF442RpXJ/WUgmeoC3lXfyChrsBHIdxOWFbNWI8+59BFZrR5mKy0 Foag== X-Gm-Message-State: AOAM5321ImZ/lyGgEN9TguKYRcncIAzsgm0QB5AqwtlOK+7fStKOYDoP OH3m0yMpxVNOS/oH0zx0Jw2wc5zof3B5QHdGM4w= X-Google-Smtp-Source: ABdhPJwEOXEDV9UOp5ApYivzL2MZgugantjnrA5RJ2d0KBvU1R+MuNxlyiIxTlrN0VT9asPVB+EcABjwkjPyG0l83SI= X-Received: by 2002:a25:bdcf:: with SMTP id g15mr9970068ybk.311.1617081770948; Mon, 29 Mar 2021 22:22:50 -0700 (PDT) MIME-Version: 1.0 References: <87ft13uzzm.fsf@oldenburg.str.redhat.com> In-Reply-To: <87ft13uzzm.fsf@oldenburg.str.redhat.com> From: Lokesh Janghel Date: Tue, 30 Mar 2021 10:52:40 +0530 Message-ID: Subject: Re: iconv: illegal input sequence To: Florian Weimer Cc: Lokesh Janghel via Libc-alpha , libc-locales@sourceware.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=1.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Level: * 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: Tue, 30 Mar 2021 05:22:55 -0000 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 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 .#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 >