Message6615

Author amak
Recipients amak, amyhlin
Date 2011-08-26.20:33:56
SpamBayes Score 1.3670176e-12
Marked as misclassified No
Message-id <1314390837.15.0.877819185566.issue1792@psf.upfronthosting.co.za>
In-reply-to
Content
> When issuing WebSphere Application Server wsadmin command to display a list of 
> WebSphere configuration object identification such as node ID, it returns the 
> jython unicode string (u'xxxx) instead of regular string in jython 2.5.2. 
> Does the behavior change in v2.5.2?  

Yes, jython string handling has changed between 2.1 and 2.5, in that unicode strings are now the default string type.

> Is any way to prevent this? 

I believe that the problem and solution is in IBMs wsdamin code, which I don't think is open source, and so we can't examine or change it. You could try contacting IBM about this.

However, why would you want to prevent it? What problems is it causing for you?

There are simple ways to work around this kind of issue. Give us an example of the problem you face?

For example, if you want to restrict your processing to iso-8859-1 strings (which is possibly what you're expecting), then run this operation on every string before you process it.

try:
    my_string = ws_unicode_string.encode('iso-8859-1')
except UnicodeEncodeError:
    print "Ouch! That string contained funny characters!"
    raise
History
Date User Action Args
2011-08-26 20:33:57amaksetmessageid: <1314390837.15.0.877819185566.issue1792@psf.upfronthosting.co.za>
2011-08-26 20:33:57amaksetrecipients: + amak, amyhlin
2011-08-26 20:33:57amaklinkissue1792 messages
2011-08-26 20:33:56amakcreate