0

I am using both cvs and bzr for versioning and prefer running both in a powershell console. But when I run cvs, it changes the console encoding, which makes bzr throw error messages. I tried setting $OutputEncoding to UTF-8 in my PSProfile and then bzr seems happy... until I run cvs, then bzr starts to complain again - even though $OutputEncoding is the same!?

Is there any way to get the two to work in the same console?

Windows PowerShell
Copyright (C) 2009 Microsoft Corporation. All rights reserved.


Visual Studio 2010 Command Prompt variables set.
PS W:\> [Console]::OutputEncoding.EncodingName
Western European (DOS)
PS W:\> bzr st
bzr: ERROR: Not a branch: "W:/".
PS W:\> [Console]::OutputEncoding.EncodingName
Western European (DOS)
PS W:\> cvs up
cvs update: No CVSROOT specified!  Please use the `-d' option
cvs [update aborted]: or set the CVSROOT environment variable.
PS W:\> [Console]::OutputEncoding.EncodingName
Unicode (UTF-8)
PS W:\> bzr st
bzr: warning: unknown terminal encoding cp65001.
  Using encoding cp1252 instead.
bzr: warning: unknown terminal encoding cp65001.
  Using encoding cp1252 instead.
bzr: ERROR: Not a branch: "W:/".
PS W:\>

Example with forcing OutputEncoding to UTF8 in the PSProfile.

Windows PowerShell
Copyright (C) 2009 Microsoft Corporation. All rights reserved.


Visual Studio 2010 Command Prompt variables set.
PS W:\> $OutputEncoding


BodyName          : utf-8
EncodingName      : Unicode (UTF-8)
HeaderName        : utf-8
WebName           : utf-8
WindowsCodePage   : 1200
IsBrowserDisplay  : True
IsBrowserSave     : True
IsMailNewsDisplay : True
IsMailNewsSave    : True
IsSingleByte      : False
EncoderFallback   : System.Text.EncoderReplacementFallback
DecoderFallback   : System.Text.DecoderReplacementFallback
IsReadOnly        : True
CodePage          : 65001



PS W:\> bzr st
bzr: ERROR: Not a branch: "W:/".
PS W:\> cvs up
cvs update: No CVSROOT specified!  Please use the `-d' option
cvs [update aborted]: or set the CVSROOT environment variable.
PS W:\> $OutputEncoding


BodyName          : utf-8
EncodingName      : Unicode (UTF-8)
HeaderName        : utf-8
WebName           : utf-8
WindowsCodePage   : 1200
IsBrowserDisplay  : True
IsBrowserSave     : True
IsMailNewsDisplay : True
IsMailNewsSave    : True
IsSingleByte      : False
EncoderFallback   : System.Text.EncoderReplacementFallback
DecoderFallback   : System.Text.DecoderReplacementFallback
IsReadOnly        : True
CodePage          : 65001



PS W:\> bzr st
bzr: warning: unknown terminal encoding cp65001.
  Using encoding cp1252 instead.
bzr: warning: unknown terminal encoding cp65001.
  Using encoding cp1252 instead.
bzr: ERROR: Not a branch: "W:/".
PS W:\>
Kenned
  • 568
  • 4
  • 11

1 Answers1

1

One solution is to provide a output-encoding option in your bazaar.conf.

The cp65001 was added to python 3.3 (bug.) So this would be fixed if bzr ports to py3k (I'm hoping...)

Gary van der Merwe
  • 9,134
  • 3
  • 49
  • 80
  • Thanks. I tried adding the output_encoding option to my config, and now the error message only occurs once for each invocation of bzr (regardless of the value of the option, as long as it's a valid encoding identifier). So the option doesn't completely override the terminal setting, it seems. But still - problem half solved? :) – Kenned Sep 20 '12 at 11:55