trac+bzr and encodings of source code files

Alexander Belchenko bialix at ukr.net
Fri Jun 15 09:52:31 BST 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Aaron Bentley пишет:
> Alexander Belchenko wrote:
>> Hi,
>> I have a problem with trac+bzr. Generally it works, but it treats all my source files as latin-1
>> encoded files. But they actually russian texts (cp1251). How can I teach trac+bzr to interpret them
>> as cp1251? Quick fix will enough for me.
> 
> You might be able to change BzrFileNode.get_content_type() to return
> 'text/plain; charset=cp1251'

OK. I found simple solution without changing code of trac+bzr plugin.
In the config file of project (conf/trac.ini) need to change parameter
in section "trac":

[trac]
default_charset = cp1251

And now all my russian files shown as expected.
(By default this parameter has value iso-8859-15).

I'll add this info to http://trac-hacks.org/wiki/BzrPlugin

[µ]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGclNPzYr338mxwCURAinoAKCQz3eM8N1n5S95Ytk/8tdgMWgr1QCdGdOH
t469fK9LfqA6T778PZcd8I8=
=q6OO
-----END PGP SIGNATURE-----



More information about the bazaar mailing list