我使用cvs和bzr進行版本控制,並且更喜歡在PowerShell控制檯中同時運行。 但是當我運行cvs時,它會更改控制檯編碼,這會導致bzr拋出錯誤消息。 我嘗試在我的PSProfile中將$ OutputEncoding設置爲UTF-8,然後bzr似乎很開心......直到我運行cvs,然後bzr又開始抱怨 - 即使$ OutputEncoding是相同的!?通過更改輸出編碼在控制檯中運行CVS BZR
有沒有什麼辦法讓這兩個在同一個控制檯上工作?
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:\>
在PSProfile中將OutputEncoding強制爲UTF8的示例。
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:\>
這一警告是在你的情況是無害的。 – bialix