日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

Visual Studio 2010/2013 UTF8编码调试时显示中文

發(fā)布時間:2025/3/15 编程问答 17 豆豆
生活随笔 收集整理的這篇文章主要介紹了 Visual Studio 2010/2013 UTF8编码调试时显示中文 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

VisualStudio 2010 SP1環(huán)境

?1、設(shè)置string默認(rèn)編碼為utf8,只需要在文件頭部加入以下代碼

1 #pragma execution_character_set("utf-8") //默認(rèn)使用UTF8

2、debug提示窗口顯示utf8,打開C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\Packages\Debugger\autoexp.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] ))

修改為以下內(nèi)容

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

參考:

  • autoexp.dat入門http://www.thecodeway.com/blog/?p=924
  • VS2013修改autoexp.dat已經(jīng)無效,需要修改

    C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\Packages\Debugger\Visualizers\stl.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>

    ?

    轉(zhuǎn)載于:https://www.cnblogs.com/mforestlaw/p/4564616.html

    總結(jié)

    以上是生活随笔為你收集整理的Visual Studio 2010/2013 UTF8编码调试时显示中文的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

    如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。