GenericDirCtrl, Unicode Folders and non-unicode build

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

GenericDirCtrl, Unicode Folders and non-unicode build

Donn Ingle
Hello again,
On my unicodification trail, I am wondering what a non-unicode build of
wxPython would do if a Generic Dir Control has to draw (in the tree) some
folders (or files) that are unicode strings?
Will it raise an error, ignore the non-ansi chars or display the '?' sign?

I gather, from the wiki, that a non-unicode build will decode any unicode
parameters into byte strings (via default encoding) and any strings coming
out of a widget will also be strings.

I should have a non-unicode build running to test, but can't quite afford
the time to go down a "roll-your-own" path right now.

/d



Reply | Threaded
Open this post in threaded view
|

Re: GenericDirCtrl, Unicode Folders and non-unicode build

Robin Dunn
Donn Ingle wrote:
> Hello again,
> On my unicodification trail, I am wondering what a non-unicode build of
> wxPython would do if a Generic Dir Control has to draw (in the tree) some
> folders (or files) that are unicode strings?
> Will it raise an error, ignore the non-ansi chars or display the '?' sign?

My guess is that it will just assume that the bytes that it reads from
the file system are in the same encoding it is using by default and will
display them as such.


>
> I gather, from the wiki, that a non-unicode build will decode any unicode
> parameters into byte strings (via default encoding) and any strings coming
> out of a widget will also be strings.

Yes, but that is only things going to/from python and wx methods.
Things done internally (like wx.GenericDirCtrl reading the filesystem)
may follow their own rules, like trying to use the system's filesystem
encoding, or just ignoring it...


--
Robin Dunn
Software Craftsman
http://wxPython.org  Java give you jitters?  Relax with wxPython!



Reply | Threaded
Open this post in threaded view
|

Re: GenericDirCtrl, Unicode Folders and non-unicode build

Donn Ingle
> My guess is that it will just assume that the bytes that it reads from
> the file system are in the same encoding it is using by default and will
> display them as such.
I am pretty certain, but thought I would check: Would that default encoding
be gained from:
locale.setlocale(locale.LC_ALL,'')
defenc = locale.getlocale(0)[1]
?
 
> may follow their own rules, like trying to use the system's filesystem
> encoding, or just ignoring it...
Without a way to know for sure, I'll just work on a "hope it all works out"
basis and squish bugs as they get reported.

Thanks again.
/d