Code

Changes between Version 14 and Version 15 of UnicodeBranch


Ignore:
Timestamp:
05/16/07 16:34:10 (7 years ago)
Author:
mtredinnick
Comment:

Fixed another typo.

Legend:

Unmodified
Added
Removed
Modified
  • UnicodeBranch

    v14 v15  
    8585 * Field sizes for text fields such as !TextField and !CharField are specified in terms of characters, not the number of bytes used in the encoding in the database. All databases supported by Django can handle this (i.e. their ''VARCHAR'' fields are sized in terms of characaters and can store unicode characters). So you do '''not''' need to worry about how many bytes the encoded version of your data will take up when working with lengths. 
    8686 
    87  * You might find the functions {{{django.utils.encoding.smart_string()}}} and {{{django.utils.encoding.smart_unicode()}}} useful in your application code. Particularly the latter is handy: it takes a bytestring or unicode string and returns a unicode string. It also knows to convert objects with a {{{__unicode___}}} or {{{__str__}}} method into unicode strings. So if you have a string that is either a bytestring or unicode and you wish to make it uniform -- always a unicode string -- call {{{smart_unicode()}}} on the object. 
     87 * You might find the functions {{{django.utils.encoding.smart_str()}}} and {{{django.utils.encoding.smart_unicode()}}} useful in your application code. Particularly the latter is handy: it takes a bytestring or unicode string and returns a unicode string. It also knows to convert objects with a {{{__unicode___}}} or {{{__str__}}} method into unicode strings. So if you have a string that is either a bytestring or unicode and you wish to make it uniform -- always a unicode string -- call {{{smart_unicode()}}} on the object. 
    8888 
    8989=== Databases ===