This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC 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]

Internationalization of Ada.Directories (MinGW)


Hello.

In Japanese version Windows, package Ada.Directories often raises
Name_Error with DBCS-filename. I was shocked that Get_Next_Entry
reported error when reading dir.
I looked for the reason and found gcc/ada/mingw32.h.
#define GNAT_UNICODE_SUPPORT was commented out.
If GNAT_UNICODE_SUPPORT was defined, GNAT runtime use W-version API and
"String" type has UTF-8. I consented.
But, GNAT_UNICODE_SUPPORT was NOT defined(it's default), adaint.c,
GNAT.Directory_Operations use C runtime.
C runtime takes filenames as DBCS, not UTF-8.
But, Ada.Directories.Validity(Mingw32-ver) always thinks filenames as
UTF-8. It's reason of Name_Error.
I want to correct this problem, but I do not understand the policy.
If Ada.Directories must take filenames as UTF-8, it's necessary to
insert the character-code conversion.
If Ada.Directories can take filenames according to the locale, The
condition of a-dirval-mingw.adb should be made loose.

And, if all String should always be UTF-8, the correction is needed
Ada.Text_IO(System.File_IO), etc packages used C runtime directly like
fopen, regardless of GNAT_UNICODE_SUPPORT.

Thanks.

YT


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