Changes between Version 8 and Version 9 of TracDev/UnicodeGuidelines
- Timestamp:
- Oct 14, 2006, 5:27:44 PM (18 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
TracDev/UnicodeGuidelines
v8 v9 302 302 Feel free to correct me, ask questions, etc.; this is a Wiki. :) 303 303 304 ---- 304 305 Q: When dealing with plugins that weren't designed to be unicode friendly and used unicode in favour of to_unicode, what parts of the plugin should be updated, what should use to_unicode ? --JamesMills 306 307 A: There shouldn't be any reason to replace a working call to `unicode()` by a call to `to_unicode()`, unless you specified the encoding, like in: 308 {{{ 309 ustring = unicode(data_from_trac, 'utf-8') 310 }}} 311 The above doesn't work if `data_from_trac` is actually an unicode object (you'd get `TypeError: decoding Unicode is not supported`). 312 313 In this case, either don't use `unicode` at all (0.10 and above only plugins) or replace it by `to_unicode` (0.9 and 0.10 plugins). 305 314 306 315 ----