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?

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.
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.
#1 david
Fixed in change 1112d66. Thanks!
  • +Fixed