Visual Studio 2010/2013 UTF8 encoding when debugging display Chinese

Source: Internet
Author: User
Tags visual studio 2010

VisualStudio SP1 Environment

1. Set the string default encoding to UTF8, just add the following code to the file header

1 #pragma // use UTF8 by default

2, Debug Prompt window display UTF8, open C:\Program Files (x86) \microsoft Visual Studio 10.0\common7\packages\debugger\ Autoexp.dat file Find line No. 412 to No. 413, the original text is as follows:

1 std::basic_string<char,*>{2     preview        #if ($e. _myres ) < ($e. _buf_size)) ([$e. _bx._buf,s]) #else ([$e. _bx._ptr,s]))3     stringview    #if (($e. _ Myres) < ($e. _buf_size)) ([$e. _BX._BUF,SB]) #else ([$e. _BX._PTR,SB]))

Modify to the following content

1 std::basic_string<char,*>{2     preview        #if ($e. _myres ) < ($e. _buf_size)) ([$e. _bx._buf,s8]) #else ([$e. _bx._ptr,s8]))3     stringview    #if (($e . _myres) < ($e. _buf_size)) ([$e. _bx._buf,s8b]) #else ([$e. _bx._ptr,s8b]))

Reference:

    1. Autoexp.dat Getting Started http://www.thecodeway.com/blog/?p=924

VS2013 modified Autoexp.dat is invalid and needs to be modified

C:\Program files (x86) \microsoft Visual Studio 12.0\common7\packages\debugger\visualizers\stl.natvis file, approximately 755-758 lines

1<type name="std::basic_string&lt;char,*&gt;">2<displaystring condition="_myres &lt; _buf_size">{_Bx._Buf,s8}</DisplayString>3<displaystring condition="_myres &gt;= _buf_size">{_Bx._Ptr,s8}</DisplayString>4<stringview condition="_myres &lt; _buf_size">_Bx._Buf,s8</StringView>5<stringview condition="_myres &gt;= _buf_size">_Bx._Ptr,s8</StringView>

Visual Studio 2010/2013 UTF8 encoding when debugging display Chinese

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.