This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libc/10460] "iconv" corrupts all files over 17 KB from UTF8 to UTF16


http://sourceware.org/bugzilla/show_bug.cgi?id=10460

Kalle Richter <krichter722 at aol dot de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
                 CC|                            |krichter722 at aol dot de
            Version|2.9                         |2.17
         Resolution|WORKSFORME                  |---

--- Comment #3 from Kalle Richter <krichter722 at aol dot de> ---
This behavior persists in iconv (Ubuntu EGLIBC 2.17-0ubuntu5) 2.17 if you
choose input file and output file to be the same (maybe only on an x86_64). Did
you one try to reproduce the error with a set of identical input and output
files? If I process the files in the following python script (using temporary
files) everything works fine:
<code>
#!/usr/bin/python

import os
import tempfile
import shutil

# The intention of this script is to avoid error "bus error" when processing
file iconv with identical input and output file

for (dirpath, dirnames, filenames) in
os.walk("/home/richter/sources/Aristoteles", topdown=True, onerror=None,
followlinks=False):
    #print(dirpath, dirnames, filenames)
    for filename in filenames:
        _file = os.path.join(dirpath, filename)
        #print(_file)
        file_ext_pair = _file.split(".")
        if len(file_ext_pair) > 1 and file_ext_pair[len(file_ext_pair)-1] ==
"java":
            _tempfile = tempfile.mkstemp()[1]
            os.system("iconv -f ISO-8859-15 -t utf-8 \""+_file+"\" -o
\""+_tempfile+"\"")
            os.remove(_file)
            shutil.move(_tempfile, _file)
</code>

-- 
You are receiving this mail because:
You are on the CC list for the bug.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]