From owner-freebsd-stable@FreeBSD.ORG Fri May 23 07:59:42 2014 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8E656B6A for ; Fri, 23 May 2014 07:59:42 +0000 (UTC) Received: from mail-vc0-x22f.google.com (mail-vc0-x22f.google.com [IPv6:2607:f8b0:400c:c03::22f]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4EB8B2E38 for ; Fri, 23 May 2014 07:59:42 +0000 (UTC) Received: by mail-vc0-f175.google.com with SMTP id id10so2413226vcb.20 for ; Fri, 23 May 2014 00:59:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; bh=ZecQOjBdXF5gHUxOlUH2berHH8VRk1yUxx06Qyz12mw=; b=z1JjpxIzZNgv3PUUO5jilyB2O8fHRnrFUmQAjjQcfzAdDin2cy2guRrH+V9rEkoUnY RYBmTvZrlhBOgkYbjKYLQ6fjf5pz1r8TBZfhxjGy+A8wEiXI2SrmmvXyAuA3YiqxIA88 HAyvXOI7Xjnkcz4sLiFJ+CsYfsbfNQjhPNUSGg7LwlZ+4VBaBQ7e5SRJ/zlKdgQ+U5+O K5LIzkjIm/tjhtK08qbxcEG1EGcMSWMCGBSPKsrSQTTGNjxPjUghTr4v8/aI7T+8+d6z 8sPHRn4Guxj0iG3EzNt1Dr57Gq03AX5jBr0Oph0RMdJEUyH5Fl6aH9qrMwGFD1F5KXnA +9Iw== MIME-Version: 1.0 X-Received: by 10.58.219.166 with SMTP id pp6mr2848340vec.1.1400831981419; Fri, 23 May 2014 00:59:41 -0700 (PDT) Received: by 10.52.185.2 with HTTP; Fri, 23 May 2014 00:59:41 -0700 (PDT) In-Reply-To: References: Date: Fri, 23 May 2014 11:59:41 +0400 Message-ID: Subject: Re: iconv exit code on 10.0 From: Pavel Timofeev To: freebsd-stable stable Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 May 2014 07:59:42 -0000 I've just tried 10-STABLE r266571. Same story like in 10-RELEASE. 2014-05-20 16:04 GMT+04:00 Pavel Timofeev : > Hi! > > I've encountered with wrong iconv work. > > root@timbsd:~ # uname -a > FreeBSD timbsd 10.0-RELEASE-p3 FreeBSD 10.0-RELEASE-p3 #0: Tue May 13 > 18:31:10 UTC 2014 > root@amd64-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC amd64 > > root@timbsd:~ # locale > LANG=3D > LC_CTYPE=3Dru_RU.UTF-8 > LC_COLLATE=3D"C" > LC_TIME=3D"C" > LC_NUMERIC=3D"C" > LC_MONETARY=3D"C" > LC_MESSAGES=3D"C" > LC_ALL=3D > > I have file with russian content. > root@timbsd:~ # cat /tmp/delete_it > =D0=9A=D0=B0=D0=BA=D0=BE=D0=B9-=D1=82=D0=BE =D1=82=D0=B5=D0=BA=D1=81=D1= =82 =D0=BD=D0=B0 =D1=80=D1=83=D1=81=D1=81=D0=BA=D0=BE=D0=BC. Some text on r= ussian > > =D0=95=D1=89=D0=B5 =D0=BD=D0=B5=D0=BC=D0=BD=D0=BE=D0=B3=D0=BE. Some more. > > > And I wanted to try to convert it to ISO. > root@timbsd:~ # /usr/bin/iconv -t ISO-8859-15 /tmp/delete_it > ?????-?? ????? ?? ???????. Some text on russian > > ??? ???????. Some more. > > iconv: warning: invalid characters: 31 > > root@timbsd:~ # echo $? > 0 > > > Why exit code is 0? Base iconv didn't manage to convert strings so > exit code should be more than 0. That's really bad! > > > converters/libiconv from ports works better in this case! > See: > root@timbsd:~ # /usr/local/bin/iconv -t ISO-8859-15 /tmp/delete_it > /usr/local/bin/iconv: /tmp/delete_it:1:0: cannot convert > root@timbsd:~ # echo $? > 1 > > I tried it on FreeBSD 11-CURRENT and base iconv doesn't have such problem= there. > So I hope that suitable fixes will be MFCd to 10-STABLE.