1. Marcin Kuzminski
  2. RhodeCode
  3. Issues

Issues

Issue #212 resolved

Move fallback decoding of safe_unicode into rhodecode config

Anonymous created an issue

There is a problem with viewing the contents of files in non-Unicode encoding (cp1251). I see only question marks. How to resolve this problem?

Comments (8)

  1. Anonymous

    Sorry, but I've resoled this problem :-) I just made a tiny changes to the file "/usr/local/lib/python2.7/dist-packages/RhodeCode-1.1.8-py2.7.egg/rhodecode/lib/init.py"

    --- __init__.py 2011-06-16 12:17:23.000000000 +0600
    +++ __init__.py 2011-06-17 18:04:40.000000000 +0600
    @@ -76,6 +76,9 @@
         try:
             u_str = unicode(_str, from_encoding)
         except UnicodeDecodeError:
    -        u_str = unicode(_str, from_encoding, 'replace')
    +        try:
    +            u_str = unicode(_str, from_encoding, 'strict')
    +        except UnicodeDecodeError:
    +            u_str = unicode(_str, 'cp1251', 'replace')
    
         return u_str
    

    and the similar changes to the file "/usr/local/lib/python2.7/dist-packages/vcs/utils/init.py"

  2. Log in to comment