Actions
Feature #1966
closedwindows unicode mkdir
Status:
Closed
Assignee:
-
Target version:
-
Description
=begin
Dear Ruby developers,
I'm interested in proper unicode support on windows, therefor I dive into Ruby sources and prepared initial patch (see in attachemet) which adds unicode support for mkdir. It is heavily inspired by code which is already in place in IO.c file. However, it opens many questions.
- It is obvious that Ruby is based on POSIX and whole windows support is one big hack (I apologize, I didn't meant to offend somebody). So instead of calling directly POSIX mkdir, I introduced method pi_mkdir, i.e. "platform independend" or "platform interface" mkdir, which is ifdeffed to dir_s_mkdir_internal on POSIX systems and to rb_w32_mkdir on windows.
- Since the file system encoding is platform specific. Therefore I changed interface of rb_w32_mkdir from (const char *, int) to (unsigned long, int). The unsigned long should be actually VALUE of RString. Unfortunately, in C it is not possible to use type deffed VALUE in exported functions, therefore I felt back to unsigned long. Anybody has idea for nice solution?
- I introduced w32_utf16 method which returns utf16 encoding for string conversions. Initially, I thought that it could be static global variable. Unfortunately, I did not found proper place for one time initialization. Is there some suitable place?
- The w32_utf16 function could be replaced by some method like RStringToWChar. Is there such method by chance?
- Is somewhere described naming conventions? Where to use rb_ prefix etc? It seems to me that the naming is rather unclear.
- Is there some recommendation regarding white spaces? In .c files, there is always mix of spaces and tabs which is not good.
It might be that I forgot some questions, so I will ask them in discussion :)
=end
Files
Actions
Like0
Like0Like0Like0Like0Like0Like0