The GNAT Reference Manual (8.6) specifies: `The default encoding method for the standard files, and for opened files for which no WCEM parameter is given in the FORM string matches the wide character encoding specified for the main program (the default being brackets encoding if no coding method was specified with -gnatW).' However, if an empty FORM string is given to Open or Create, the WCEM is always set to brackets coding, regardless of the encoding method that has been specified with -gnatW: Set_WCEM (a-witeio.adb:1632): `if Start = 0 then File.WC_Method := WCEM_Brackets; else' from `gcc -v': `Target: x86_64-linux-gnu Configured with: ../src/configure -v --with-pkgversion='Debian 4.4.3-2' --with-bugurl=file:///usr/share/doc/gcc-4.4/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --enable-shared --enable-multiarch --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.4 --program-suffix=-4.4 --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-objc-gc --with-arch-32=i486 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu gcc version 4.4.3 (Debian 4.4.3-2)'
Created attachment 19845 [details] Expected Output % gnatmake -f -gnatW8 u8 gcc-4.4 -c -gnatW8 u8.adb gnatbind -x u8.ali gnatlink u8.ali % ./u8 `[הצ�]' %
Created attachment 19846 [details] Constraint_Error because the file is opened with bracket coding % gnatmake -f -gnatW8 u8_fail gcc-4.4 -c -gnatW8 u8_fail.adb gnatbind -x u8_fail.ali gnatlink u8_fail.ali % ./u8-fail raised CONSTRAINT_ERROR : s-wchcnv.adb:209 explicit raise %
Created attachment 19847 [details] Test file The test file used to demonstrate the issue.
Still fails on mainline.