1409: convert_to_utf8 returns utf-8 basetring but not unicode

alle****@gmai***** (Google Code) (Is this you? Claim this profile.)
Nov. 28, 2009
What version are you running?
1.0.5.1

What steps will reproduce the problem?
Needs repository with ecoding different from utf-8 (for ex. koi8-r).

What is the expected output? What do you see instead?
In tap (for ex.) ViewDiff in place where must be cirilic symbols we can see
only not readable symbols.

What operating system are you using? What browser?
Linux, Firefox

Please provide any additional information below.
reviewboard/diffviewer/diffutils.py
convert_to_utf8 function returns unicode string in only case if codepage
repository is utf-8. In other cases it returns basestring in code utf-8.

For fixing propose change "return u.encode('utf-8')" by "return u" in case
if uncode(s, 'utf-8') fails and repository has user encoding.
david
#1 david
Fixed in change 1112d66. Thanks!
  • +Fixed