Bazaar: "???" instead of non ASCII character in paths on non UTF-8 locale
|Assignee:||Toshi MARUYAMA||% Done:|
- Redmine 2.0.3
- Ruby 1.8.7
- Rails 3.2.6
- Apache 2.2
I'm using Redmine on Windows XP SP3 Rus and Windows Server 2003 Rus (cp1251). There is a problem with browsing Bazaar repository containing cyrillic symbols in repository filenames and paths. I see ??? instead of cyrillic symbols.
I didn't find solution of this problem anywhere. Is there one?
So, I checked other scm *_adapter.rb and made same 'bzr' output encoding convertion, so everything works now (see attached files, they contains comments of basic changes). Was it useless?Changes:
- Added path encoding setup when adding Bazaar repo (same as for the filesystem).
- Removed log encoding setup, because of Bazaar is storing all comments in utf8 inside and outputs them with same encoding as for the path.
P.S. Saw Ruby for the first time when started to do this
scm: bazaar: update test repository (#11834)
Add new "non_ascii" branch.
It was created by "bzr branch --no-tree branch00 non_ascii".
It is equivalent to Git bare repository and Mercurial "hg update null".
It has non ASCII path name files and directory.
scm: bazaar: add @path_encoding instance value and set it UTF-8 at adapter initialize method (#11834)
scm: bazaar: convert path encoding from @path_encoding to UTF-8 at adapter revisions method (#11834)
scm: bazaar: convert path encoding from @path_encoding to UTF-8 at adapter entries method (#11834)
scm: bazaar: do not call super initialize method at adapter (#11834)
On Bazaar 2.0.5, in case of using non ASCII repository path,
following trace raise on all operation.
Traceback (most recent call last): File "/usr/bin/bzr", line 142, in <module> exit_val = bzrlib.commands.main() File "/usr/lib/python2.6/site-packages/bzrlib/commands.py", line 1102, in main argv = osutils.get_unicode_argv() File "/usr/lib/python2.6/site-packages/bzrlib/osutils.py", line 90, in get_unicode_argv "encoding." % a)) bzrlib.errors.BzrError: Parameter ''/somewhere/\xe3\x83\x90\xe3\x82\xb6\xe3\x83\xbc/non_ascii/'' is unsupported by the current encoding.
#1 Updated by Alexander Usenko over 9 years ago
There can be a problem with file annotation view (simple file view is Ok). "Attachments and repositories encodings" in application settings must be set to "UTF-8, CP1251", not to "CP1251, UTF-8". Last case causes file to look like it is encoded in UTF-8, but is browsed in CP1251.
What is being seen:
С‚РµСЃС‚ С‚РµСЃС‚ С‚РµСЃС‚
What should be seen:
тест тест тест
Maybe i forgot smth in annotate function of bazaar_adapter.rb