Conversion to UCS-2 encoding in GNU libiconv returns bytes in network order. gcj wants to have them in host order. The hack in libgcj swaps bytes when necessary. However, command line arguments slip by the swapper (or go through it even number of times).
This produces unrecognizable for a program command line arguments. There is a non-zero probability of this producing invalid UTF-16 strings, e.g. with unpaired surrogates. That, in turn, may result in segmentation faults during string operations, especially I/O character encoding conversion. -- Summary: Command line arguments are byteswapped before being passed to the program runing in custom locale. Product: gcc Version: 4.1.3 Status: UNCONFIRMED Severity: normal Priority: P3 Component: libgcj AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: serg at vostok dot net GCC build triplet: i386-portbld-freebsd6.2 GCC host triplet: i386-portbld-freebsd6.2 GCC target triplet: i386-portbld-freebsd6.2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31939