`
dewei
  • 浏览: 163046 次
  • 性别: Icon_minigender_1
  • 来自: 南京
社区版块
存档分类
最新评论

Visual Studio 2010/2013 string对UTF8的支持总结

 
阅读更多

VisualStudio 2010 SP1环境

 

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

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

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

std::basic_string<char,*>{
	preview		( #if (($e._Myres) < ($e._BUF_SIZE)) ( [$e._Bx._Buf,s] ) #else ( [$e._Bx._Ptr,s] ))
	stringview	( #if (($e._Myres) < ($e._BUF_SIZE)) ( [$e._Bx._Buf,sb] ) #else ( [$e._Bx._Ptr,sb] ))

 修改为以下内容

std::basic_string<char,*>{
	preview		( #if (($e._Myres) < ($e._BUF_SIZE)) ( [$e._Bx._Buf,s8] ) #else ( [$e._Bx._Ptr,s8] ))
	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.0\Common7\Packages\Debugger\Visualizers\stl.natvis文件,大约755-758行

<Type Name="std::basic_string&lt;char,*&gt;">
    <DisplayString Condition="_Myres &lt; _BUF_SIZE">{_Bx._Buf,s8}</DisplayString>
    <DisplayString Condition="_Myres &gt;= _BUF_SIZE">{_Bx._Ptr,s8}</DisplayString>
    <StringView Condition="_Myres &lt; _BUF_SIZE">_Bx._Buf,s8</StringView>
    <StringView Condition="_Myres &gt;= _BUF_SIZE">_Bx._Ptr,s8</StringView>

 

分享到:
评论

相关推荐

    visual studio 2013 C# DES 加密解密 asp.net 完整 源码 下载

    测试平台 visual studio 2013 win8.1 依据网上资源整理,并亲测,并写出窗口供调用演示,原代码全部打包奉上,可供学习使用。 public static string EncryptDES(string encryptString, string encryptKey) { ...

    《QRCode生成二维码(支持中文)源码》

    要将中文信息生成为二维码,使用了有源码的QRCode,但它默认不支持中文,在网上找到的办法,一般都是... 开发环境为Visual Studio 2010 本资料共包含以下附件: QRCodeChina_75404f5d-176b-4928-b288-989e19f624d8.zip

    C#实现的字符串转MD5码函数实例

    测试环境:WinXP SP3、Visual Studio 2008 SP1、Visual Studio 2010 SP1 更新日期:2014-04-23 */ public string CalculateMD5Hash(string input) { MD5 md5 = System.Security.Cryptography.MD5.Create(); byte[] ...

    ZvLibs 0.0.0.69

    * c++ 类可扩展,继承 CHttpHandle,很容易实现动态页面。 * 支持 multipart/form-data 格式的表单上传文件。 * 使用map&lt;string, string&gt; 存放表单、URL ... * 内有demo程序,在visual studio 2008 下编译通过。

    c# 加密和解密相关代码

    (1)打开Visual Studio 2008 开发环境,新建一个Windows窗体应用程序,并将其命名为Encrypt。 (2)更改默认窗体Form1 的Name 属性为Frm_Main,在该窗体中添加两个GroupBox 容器控件,其中, 在第一个GroupBox 中放...

    C#与.NET3.5高级程序设计(第4版) 中文1

    http://www.amazon.com/Pro-2010-NET-Platform-Fifth/dp/1430225491/ref=sr_1_1?ie=UTF8&s=books&qid=1261446530&sr=8-1 C#与.NET3.5高级程序设计(第4版) 中文 其他网友本资源我下了,都没有下载下来 本人从其他...

    网页页面图片批量下载

    string pageData = Encoding.UTF8.GetString(e.Result); List&lt;string&gt; urlList = new List&lt;string&gt;(); //匹配全路径 match = Regex.Match(pageData, @"((http(s)?://)?)+(((/?)+[\w-.]+(/))*)+[\w-./]+\.+(" + ...

    DbEntry原版文档2003.doc

    • Create a console application using Visual Studio 2008. • Create a new Access mdb file named test.mdb , and store it to c:\. If you are using Access 2007, please save it as Access 2003 format. •...

    FastReport.v4.15 for.Delphi.BCB.Full.Source企业版含ClientServer中文修正版支持D4-XE5

    FastReport.v4.15 for.Delphi.BCB.Full.Source企业版含ClientServer中文修正版支持Delphi 4-XE5 and C++Builder 6-XE5. D2010以上版本(D14_D19)安装必读 delphi2010以上版本(D14_D19)使用者安装时,请将res\frccD14_...

    C#网页版+客户端版聊天软件

    ConstructorInfo ctor = handlerType.GetConstructor(new Type[] { typeof(HttpContext), typeof(String), typeof(String), typeof(String) }); CommandHandler handler = ctor.Invoke(new object[] { context, ...

    msgpack-python-0.4.2.tar

    &gt;&gt;&gt; msgpack.unpackb(packed, encoding='utf-8') ['spam', u'egg'] You shoud use it carefully. When you use ``use_bin_type=True``, packed binary can be unpacked by unpackers supporting msgpack-2.0. To...

    Qt Creator 的安装和hello world 程序+其他程序的编写--不是一般的好

    程序里我们先建立一个主工程,作为主界面,然后再建立一个对 话框类,将其加入工程中,然后在程序中调用自己新建的对话框类来实现多窗口。 实现过程: 1.首先新建Qt4 Gui Application 工程,工程名为nGui,Base ...

    Bochs - The cross platform IA-32 (x86) emulator

    [3011112] error compile vs2008/2010 with X2APIC [3002017] compile error with vs 2010 [3009767] guest RFLAGS.IF blocks externel interrupt in VMX guest mode [2964655] VMX not enabled in MSR IA32_...

Global site tag (gtag.js) - Google Analytics