Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Currently I'm running Windows 7 x64 and usually I want all console tools to work with UTF-8 rather than with default code page 850.

Running chcp 65001 in the command prompt prior to use of any tools helps but is there any way to set is as default code page?

Update:

Changing HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Nls\CodePage\OEMCP value to 65001 appear to make the system unable to boot in my case.

Proposed change of HKEY_LOCAL_MACHINE\Software\Microsoft\Command Processor\Autorun to @chcp 65001>nul served just well for my purpose. (thanks to Ole_Brun)

share|improve this question
add comment

2 Answers

up vote 16 down vote accepted

To change the codepage for the console only, do the following:

  1. Start->Run->regedit
  2. Go to [HKEY_LOCAL_MACHINE\Software\Microsoft\Command Processor\Autorun]
  3. Change the value to chcp 65001
share|improve this answer
    
The SO question you referenced doesn't appear to have anything about how to set any code page as default. –  Regent Apr 12 '11 at 12:35
    
Hmm, I thought it did... Anyways, updated my answer to include the steps to change default codepage. –  Nils Magne Lunde Apr 12 '11 at 12:46
3  
Be aware that changing the codepage will not only affect the console though. To make it only apply to the console, you could put chcp 65001 into the HKEY_LOCAL_MACHINE\Software\Microsoft\Command Processor\Autorun. –  Nils Magne Lunde Apr 12 '11 at 12:54
1  
Surprisingly changing the OEMCP registry setting made my system unable to boot so I had to use system recovery to restore to working state. Autorun did the trick, however. –  Regent Apr 12 '11 at 13:35
1  
@Regent: If this solution makes your system unbootable, why did you mark it as accepted, then? –  Tim Pietzcker Sep 19 '12 at 14:25
show 3 more comments

I don't like change the system. This creates a lot of problems for me. I created a batch file:

@ECHO OFF
REM change CHCP to UTF-8
CHCP 65001
CLS

I saved at C:\Windows\System32 as switch.bat.

I created a link for cmd.exe on the Desktop.

In the properties of cmd, changed the destination to: C:\Windows\System32\cmd.exe /k switch

Voilá, when I need to type in UTF-8, I use this link.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.