Unicode drives me crazy...

2005-07-04 Thread [EMAIL PROTECTED]
Hi ! I want to get the WMI infos from Windows machines. I use Py from HU (iso-8859-2) charset. Then I wrote some utility for it, because I want to write it to an XML file. def ToHU(s,NoneStr='-'): if s==None: s=NoneStr if not (type(s) in [type(''),type(u'')]): s=str(s) if type

RE: Unicode drives me crazy...

2005-07-04 Thread Tim Golden
[EMAIL PROTECTED] | I want to get the WMI infos from Windows machines. | I use Py from HU (iso-8859-2) charset. OK, there are people better placed than I to explain about Unicode. Check out the following article, for example: http://www.joelonsoftware.com/printerFriendly/articles/Unicode.html b

Re: Unicode drives me crazy...

2005-07-04 Thread Sybren Stuvel
[EMAIL PROTECTED] enlightened us with: > I want to get the WMI infos from Windows machines. > I use Py from HU (iso-8859-2) charset. Why not use Unicode for everything? Sybren -- The problem with the world is stupidity. Not saying there should be a capital punishment for stupidity, but why don't

Re: Unicode drives me crazy...

2005-07-04 Thread Fuzzyman
[EMAIL PROTECTED] wrote: > Hi ! > > I want to get the WMI infos from Windows machines. > I use Py from HU (iso-8859-2) charset. > > Then I wrote some utility for it, because I want to write it to an XML file. > > def ToHU(s,NoneStr='-'): > if s==None: s=NoneStr > if not (type(s) in [type(

Re: Unicode drives me crazy...

2005-07-04 Thread Fuzzyman
At some point you have to convert - esp. when writing data out to file. If you receive data as a byte string and have to store it as a byte string, it is sometimes convenient to *not* convert in the middle. Best Regards, Fuzzy http://www.voidspace.org.uk/python -- http://mail.python.org/mailman

Re: Unicode drives me crazy...

2005-07-04 Thread John Roth
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi ! > > I want to get the WMI infos from Windows machines. > I use Py from HU (iso-8859-2) charset. > > Then I wrote some utility for it, because I want to write it to an XML > file. > > def ToHU(s,NoneStr='-'): >if s==None: s=Non