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:\>