Bug in dir() leads to Unicode and win_dir()
- Posted by Greg Haberek <ghaberek at gmail.com> Jul 14, 2005
- 535 views
While working on my Backup Utility for work, I found a bug in Euphoria's dir() routine. It does not support extended ASCII characters and just returns a question mark '?' in place of unknown characters. I therefore have written a function called win_dir() which uses Unicode strings to full support all available characters, as well as up to 32,767 character path names, instead of just 255. It only works with Windows obviously, since it calls FindFirstFileW, FindNextFileW, and FindClose in kernel32.dll. Seeing as how I forced myself to learn how Unicode strings work, I also wrote a Unicode Conversion Library that can convert plain ASCII strings (or sequences) to Unicode values, as well as two very useful routines, allocate_unicode() and peek_unicode(). Both libraries, windir.zip and unicode.zip have just been uploaded to the Archive. I hope others find these as useful as I do, especially Derek, who IMHO should implement Unicode in Win32Lib so that it will be more compatible with the Windows environment. ~Greg