[MERGE] Running bzr from vim scripts gives 'unknown encoding warning'

John Arbash Meinel john at arbash-meinel.com
Mon May 5 20:50:15 BST 2008


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

Neil Martinsen-Burrell wrote:
| I'm trying out the Bazaar integration in Vim using VCSCommand and
| vcsbzr.vim and I was getting the message
|
| """
| bzr: warning: unknown encoding . Continuing with ascii encoding.
| """
|
| before every command's output.  For whatever reason, with Vim 7.0 on Mac
| OS X 10.5.2, python was returning '' for locale.getpreferredencoding()
| which is not a valid codec, so we got the 'unknown encoding warning'.
| For such a non-informative encoding as '', I think we should just assume
| (as we do for None and 'cp0') that we should use ascii encoding and not
| complain (as the attached patch does).
|
| A more philosophically appealing fix would be to find out what encoding
| vim wants and find out why that information isn't being passed on to the
| python subprocess and fix that underlying problem.  I have chosen an
| easier and less satisfying solution.
|
|

Well, I actually think it is kind of nice to get this warning since then you can
make sure your script does something like "LANG=C bzr" or "LANG=en.UTF-8 bzr".

At least, that would be my recommendation.

I'm not opposed to your patch, but it might be hiding something that would
actually make it work *correctly* with vim.

BB:comment

John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkgfZPYACgkQJdeBCYSNAAP1qgCfeNQvHlaF/AXEtry73EsnBASy
ZnIAnjIjeDGZ2vJwbcGuTiR5fI2D8Uzw
=aVkh
-----END PGP SIGNATURE-----



More information about the bazaar mailing list