Changeset - ef2f75e99c3e
[Not reviewed]
beta
0 1 0
Marcin Kuzminski - 14 years ago 2012-02-26 20:53:36
marcin@python-works.com
reverted accidentally removed function in safe_str
1 file changed with 4 insertions and 0 deletions:
0 comments (0 inline, 0 general)
rhodecode/lib/__init__.py
Show inline comments
 
@@ -229,12 +229,16 @@ def safe_str(unicode_, to_encoding=None)
 

	
 
    :param unicode_: unicode to encode
 
    :rtype: str
 
    :returns: str object
 
    """
 

	
 
    # if it's not basestr cast to str
 
    if not isinstance(unicode_, basestring):
 
        return str(unicode_)
 

	
 
    if isinstance(unicode_, str):
 
        return unicode_
 

	
 
    if not to_encoding:
 
        import rhodecode
 
        DEFAULT_ENCODING = rhodecode.CONFIG.get('default_encoding','utf8')
0 comments (0 inline, 0 general)