[bt-devel] Unicode impl on Windows (was Some pictures)

Troy A. Griffitts scribe at crosswire.org
Thu Feb 26 10:13:16 MST 2009


Dear Matthew,

I will leave the thread at this.

I agree with you and even compliment you for discovering Windows Reality.
I appreciate your solution.

The long term proper fix is to encourage the compiler toolchain teams to 
consistently fix their impl of open and getenv on all the various 
versions and locales of windows.  The work you did to call the correct 
system call should be pushed into the impl of the toolchain so all MinGW 
apps don't have to go through the pains that you went through.

    -Troy.

PS.  My 'D:' drive is FAT32



Matthew Talbert wrote:
> 2009/2/26 Troy A. Griffitts <scribe at crosswire.org>
>   
>> Dear Matthew,
>>
>> I'm sorry, but I don't remember you telling me that BibleCS did not work for you.  I just tested under Windows XP and it works fine for me.
>>
>> I'm sorry to disagree technically with you again (nothing personal) but getenv and open should be consistently implemented on whatever platform for which a C compiler is attempting to build working executables.  These methods were created long before Unicode, but now on Unicode-aware systems compilers need to make a choice what to do as 'The Right Thing' and open should AT THE VERY LEAST, be consistent with getenv.  If I receive a PATH NAME from getenv as a char *, then I should be able to pass that returned value to open.  I don't care if the impl uses 'short 8.3' DOS name alternatives, or UTF-8 (of course the best solution), they should be consistent.  The OpenFileW system call is a brute force method to do the right thing on windows, which is fine to get something working, but the implementation of the C call 'open' should call the correct system call (OpenFileW, CreateFileW, whatever) on whatever operating system for which it is implemented.
>>
>> In summary, the whole point of a compiler even supplying an implementation of the stdlib C calls is to allow a developer to avoid calling OS level calls like the Win32 API direct calls you cite.
>>
>> Do you understand my point?
>>
>>   -Troy.
>>     
>
> Of course, I understand how you would *like* things to work.
> Unfortunately, that is not how they do work. I clearly wrote in my
> email what I tried and that it didn't work with BibleCS. I suggest you
> try the same filename on a FAT32 partition and see if it works. Also
> note that this situation is dependant on the locale, so what works for
> you in English, may have a very high probability of failing in
> Chinese, and vice-versa. The internet is full of articles on this.
>
> Again, your desires to have a consistent C implementation do not
> unfortunately correspond with reality.
>
> Matthew
>
> _______________________________________________
> bt-devel mailing list
> bt-devel at crosswire.org
> http://www.crosswire.org/mailman/listinfo/bt-devel
>   





More information about the bt-devel mailing list