zoukankan      html  css  js  c++  java
  • Visual Studio 2010/2013 UTF8编码调试时显示中文

    VisualStudio 2010 SP1环境

     1、设置string默认编码为utf8,只需要在文件头部加入以下代码

    1 #pragma execution_character_set("utf-8") //默认使用UTF8

    2、debug提示窗口显示utf8,打开C:Program Files (x86)Microsoft Visual Studio 10.0Common7PackagesDebuggerautoexp.dat文件找到第412到413行,原文如下:

    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] ))

    修改为以下内容

    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] ))

    参考:

    1. autoexp.dat入门http://www.thecodeway.com/blog/?p=924

    VS2013修改autoexp.dat已经无效,需要修改

    C:Program Files (x86)Microsoft Visual Studio 12.0Common7PackagesDebuggerVisualizersstl.natvis文件,大约755-758行

    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>
  • 相关阅读:
    JS 数组总结
    JS 数据类型及其判断
    CSS 优先级
    正则表达式及其使用例子
    常见的图片格式
    React 箭头函数的使用
    手动搭建 react+webpack 开发环境
    JS 函数参数及其传递
    JS 中的 this 指向问题
    JS 中函数的 length 属性
  • 原文地址:https://www.cnblogs.com/mforestlaw/p/4564616.html
Copyright © 2011-2022 走看看