Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 109144 - iconv giving illegal input sequence for several output codepages
Summary: iconv giving illegal input sequence for several output codepages
Status: RESOLVED WORKSFORME
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Library (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-10-13 07:56 UTC by Daniel Rozsnyo
Modified: 2006-04-20 20:50 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Rozsnyo 2005-10-13 07:56:18 UTC
When trying to convert UTF8 text or even plain-ascii into windows-1250 (cp1250),
I get an empty string in PHP, and an error on command line. This happens on two
of my machines with gentoo ~x86 which are administered in the same way, i
downgraded glibc on the faster of them, and the error is same:

a03-0431a ~ # echo 'aaa' | iconv -f ascii -t cp1250; iconv --version | head -n 1
iconv: illegal input sequence at position 0
iconv (GNU libc) 2.3.5

daniel ~ # echo 'aaa' | iconv -f ascii -t cp1250; iconv --version | head -n 1
iconv: illegal input sequence at position 0
iconv (GNU libc) 2.3.4

a03-0431a ~ # php
<?php var_dump(iconv('ascii','cp1250','aaa')); ?>
PHP Notice:  iconv(): Detected an illegal character in input string in /root/-
on line 1

Notice: iconv(): Detected an illegal character in input string in /root/- on line 1
string(0) ""



Reproducible: Always
Steps to Reproduce:
1. echo aaa | iconv -f ascii -t cp1250

Actual Results:  
iconv: illegal input sequence at position

Expected Results:  
aaa

Portage 2.0.53_rc5 (default-linux/x86/2005.1, gcc-3.3.6, glibc-2.3.5-r2,
2.6.13.1 i686)
=================================================================
System uname: 2.6.13.1 i686 Celeron (Mendocino)
Gentoo Base System version 1.12.0_pre9
dev-lang/python:     2.3.5, 2.4.2
sys-apps/sandbox:    1.2.13
sys-devel/autoconf:  2.13, 2.59-r7
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r1
sys-devel/binutils:  2.16.1
sys-devel/libtool:   1.5.20
virtual/os-headers:  2.6.11-r2
ACCEPT_KEYWORDS="x86 ~x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O3 -march=pentium2 -fomit-frame-pointer -mmmx"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3/share/config
/usr/share/config /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-O3 -march=pentium2 -fomit-frame-pointer -mmmx"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig distlocks sandbox sfperms strict"
GENTOO_MIRRORS="http://distfiles.gentoo.org
http://distro.ibiblio.org/pub/linux/distributions/gentoo"
LANG="en_US.UTF-8"
LC_ALL="en_US.UTF-8"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="x86 apache2 authdaemond bcmath berkdb bzip2 calendar cli crypt ctype cups
curl dba encode exif fam foomaticdb ftp gd gdbm gif iconv imap imlib ipv6 jpeg
libg++ libwww lm_sensors maildir mhash mp3 mpeg mysql ncurses nls ogg pam pcntl
pcre pdflib perl php png posix qt quicktime readline samba sasl session
simplexml slang snmp soap sockets spell sqlite ssl syslog tcpd threads tidy tiff
tokenizer unicode userlocales utf8 vorbis wddx xml xml2 xmlrpc xsl zip zlib
userland_GNU kernel_linux elibc_glibc"
Unset:  ASFLAGS, CTARGET, LDFLAGS, LINGUAS, PORTDIR_OVERLAY
Comment 1 SpanKY gentoo-dev 2006-04-20 20:50:32 UTC
works for me with 2.4 / 2.3.6:

$ echo 'aaa' | iconv -f ascii -t cp1250; iconv --version | head -n 1
aaa
iconv (GNU libc) 2.4

$ echo 'aaa' | iconv -f ascii -t cp1250; iconv --version | head -n 1
aaa
iconv (GNU libc) 2.3.6

if it still fails, try rebuilding glibc with USE=-userlocales