Discussion:
iconv: (stdin): cannot convert
Nedunchezhiyan, Sanjayan
2005-05-18 14:26:19 UTC
Permalink
Hi

Im trying to convert ASCII code into CP1250,CP1252 and vice versa. I
donwloaded the iconv exe file from the website and tried converting. I used
the following command :-

iconv -f CP1250 -t ASCII <sample.txt > asc.txt

in the command prompt. It is giving me the following error.

iconv: (stdin): cannot convert

I tried a simple file with english chars, then it is not throwing error but
just replicating the same. Can you pls help me over what could be the
problem.

Regards
Sanjayan
Jürgen Kahrs
2005-05-18 19:55:08 UTC
Permalink
Post by Nedunchezhiyan, Sanjayan
Im trying to convert ASCII code into CP1250,CP1252 and vice versa. I
donwloaded the iconv exe file from the website and tried converting. I used
This sounds like you are working on an MS Windows
platform. Are you sure that downloading the iconv.exe
is really sufficient to get an iconv which is set up
correctly ? Usually there are conversion tables to
be installed separately.
Post by Nedunchezhiyan, Sanjayan
the following command :-
iconv -f CP1250 -t ASCII <sample.txt > asc.txt
in the command prompt. It is giving me the following error.
iconv: (stdin): cannot convert
I think iconv may have responded correctly.
Are you sure that your CP1250 content can
be expressed in ASCII ? Maybe you should
convert to UTF-8.
Post by Nedunchezhiyan, Sanjayan
I tried a simple file with english chars, then it is not throwing error but
just replicating the same. Can you pls help me over what could be the
problem.
This sounds like your iconv works correctly in principle.
Bruno Haible
2005-05-20 09:53:19 UTC
Permalink
Post by Nedunchezhiyan, Sanjayan
Im trying to convert ASCII code into CP1250,CP1252 and vice versa. I
donwloaded the iconv exe file from the website and tried converting. I used
the following command :-
iconv -f CP1250 -t ASCII <sample.txt > asc.txt
in the command prompt. It is giving me the following error.
iconv: (stdin): cannot convert
bug-gnu-libiconv is the right channel for reporting this, not
bug-gnu-gettext. But anyway...

The error means that either the input file is not in CP1250, or that its
contents cannot be converted to ASCII without losing too much contents.

You can determine the line where the first problematic character occurs
by looking which is the last line in the generated output file. libiconv-1.10
will directly report line numbers.

Bruno

Loading...