前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >解决在反编译中出现中文字符都表示成16进制Unicode的形式

解决在反编译中出现中文字符都表示成16进制Unicode的形式

作者头像
阿新
发布2018-04-13 10:04:49
1.2K0
发布2018-04-13 10:04:49
举报
文章被收录于专栏:c#开发者c#开发者

在vs.net 2003中打开[Tools]-[macros]-[macros explorer] 然后将下面的代码copy-paste 进去 代开你要转换的cs文件,在mymacros form中单击dubug就可以了

代码语言:javascript
复制
Imports EnvDTE
Imports System.Globalization
Imports System.Text.RegularExpressions
Imports System.Diagnostics
Public Module Birdshome
    Sub Unicode2Character()
        Dim doc As Document = DTE.ActiveDocument
        Dim docText As TextDocument = doc.Object
        Dim selText As TextSelection = docText.Selection()
        selText.SelectAll()
        Dim text As String = selText.Text
        Dim iLength As Integer
        Do
            iLength = text.Length
            Dim m As Match
            Dim strPattern As String = "(?<code>\\u[A-F0-9]{4})"
            m = Regex.Match(text, strPattern, RegexOptions.IgnoreCase)
            If m.Success Then
                Dim strValue As String
                strValue = m.Groups("code").Value
                text = text.Replace(strValue, "")
                Dim int As Integer
                int = System.Int32.Parse(strValue.Substring(, ), NumberStyles.HexNumber)
                Dim ch As Char = ChrW(int)
                docText.ReplacePattern(strValue, ch)
            Else
                Exit Do
            End If
            If Not text.Length < iLength Then
                Exit Do
            End If
        Loop
        selText.StartOfDocument()
    End Sub
End Module

一切就都搞定了 希望能给大家提供一些帮助

本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2007-01-30 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档