This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Re: Patch: New version of "UTF-16 to 'Win32 locale' conversions"and filenames (replacing convertion tables with Win32 API calls)
- From: João Garcia <jgarcia at uk2 dot net>
- To: Bryce McKinlay <bryce at mckinlay dot net dot nz>
- Cc: gnustuff at thisiscool dot com, java-patches at gcc dot gnu dot org
- Date: Fri, 19 Sep 2003 14:42:07 +0100
- Subject: Re: Patch: New version of "UTF-16 to 'Win32 locale' conversions"and filenames (replacing convertion tables with Win32 API calls)
- References: <14027688-EA54-11D7-9D40-003065F97F7C@mckinlay.net.nz>
Bryce McKinlay wrote:
Rather than making up a C++ interface, I'd prefer to see wrappers
around these native conversion routines implemented with a
gnu.gcj.convert interface - or even better, java.nio.charset. Charset
conversions need to be done in various places besides java.io.File
(AWT, for example), and it would be great to have access to them from
Java code. It also means we won't have to write separate code for
POSIX and Win32 everywhere to do the character conversions. A
different win32 java.nio.charset provider could be registered at
startup depending on whether 9x or NT is used, avoiding the extra
indirection.
This is the approach I intend to take for the posix File
implementation when time allows.
This seems an excelent approach!
The same kind of approach has been taken for SWT (see OS.java in
org.eclipse.internal.win32).
Since MultiByteToWideChar()/WideCharToMultiByte() functions are also
available in NT/2000/XP, I cannot find any reason to loose time with a
temporary patch using a C++ interface. Therefore I shall only propose a
temporary patch for GCC 3.4, using A-functions.
João