Changeset - abe75448253c
[Not reviewed]
Merge default
0 3 0
Marcin Kuzminski - 14 years ago 2012-02-26 17:09:28
marcin@python-works.com
merged beta into stable
2 files changed with 4 insertions and 7 deletions:
0 comments (0 inline, 0 general)
docs/theme/nature/layout.html
Show inline comments
 
{% extends "basic/layout.html" %}
 

	
 
{% block sidebarlogo %}
 
<h3>Support RhodeCode development.</h3>
 
<div style="text-align:center">
 
	<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
 
	<input type="hidden" name="cmd" value="_s-xclick">
 
	<input type="hidden" name="hosted_button_id" value="8U2LLRPLBKWDU">
 
	<input style="border:0px !important" type="image" src="https://www.paypal.com/en_US/i/btn/btn_donate_SM.gif"
 
	border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
 
	<img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1">
 
	</form>
 
	<div style="padding:5px">
 
    <a href="http://flattr.com/thing/167489/RhodeCode" target="_blank">
 
    <img src="http://api.flattr.com/button/flattr-badge-large.png" alt="Flattr this" title="Flattr this" border="0" /></a>
 
    </div>	
 
    <div style="padding:5px">
 
     <a href="http://flattr.com/thing/167489/RhodeCode" target="_blank">
 
     <img src="http://api.flattr.com/button/flattr-badge-large.png" alt="Flattr this" title="Flattr this" border="0" /></a>
 
   </div>  
 
</div>
 
{% endblock %}}
rhodecode/lib/__init__.py
Show inline comments
 
@@ -226,27 +226,24 @@ def safe_str(unicode_, to_encoding=None)
 

	
 
    In case of UnicodeEncodeError we try to return it with encoding detected
 
    by chardet library if it fails fallback to string with errors replaced
 

	
 
    :param unicode_: unicode to encode
 
    :rtype: str
 
    :returns: str object
 
    """
 
    
 
    if not isinstance(unicode_, basestring):
 
        return str(unicode_)
 

	
 
    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')
 
        to_encoding = DEFAULT_ENCODING
 

	
 
    try:
 
        return unicode_.encode(to_encoding)
 
    except UnicodeEncodeError:
 
        pass
0 comments (0 inline, 0 general)