reflector的中文支持方法
2007-02-12 16:14
459 查看
本来想找个插件,但发现了这个
Reflector是我目前用的最多的反编译工具,他可能不时最好的,但以它的更新速度,我相信他会成为最好的哦
~~
国外的软件,对中文支持还是有问题,虽然我们都Unicode了,可是老外还是不一定认账。Reflector反编译代码,Unicode中非英文的字符都显示为了/u????,这本来还是对的,可是我们看起来就太郁闷了
。Reflector支持Plug-in,曾经想写个插件,结果要了解的东西太多,就放弃了。不过问题也解决了,用VS.NET带的宏,haha
转换前的代码,谁能看懂写的啥呀@_@?
不要担心,转换后的代码就成了:
VS.NET 宏代码,名称:Unicode2Character
Imports EnvDTE
Imports System.Globalization
Imports System.Text.RegularExpressions
Imports System.Diagnostics
Public Module BirdshomeModule Birdshome
Sub Unicode2Character()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(2, 4), 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
enjoy it!
Reflector是我目前用的最多的反编译工具,他可能不时最好的,但以它的更新速度,我相信他会成为最好的哦
~~
国外的软件,对中文支持还是有问题,虽然我们都Unicode了,可是老外还是不一定认账。Reflector反编译代码,Unicode中非英文的字符都显示为了/u????,这本来还是对的,可是我们看起来就太郁闷了
。Reflector支持Plug-in,曾经想写个插件,结果要了解的东西太多,就放弃了。不过问题也解决了,用VS.NET带的宏,haha
转换前的代码,谁能看懂写的啥呀@_@?
不要担心,转换后的代码就成了:
VS.NET 宏代码,名称:Unicode2Character
Imports EnvDTE
Imports System.Globalization
Imports System.Text.RegularExpressions
Imports System.Diagnostics
Public Module BirdshomeModule Birdshome
Sub Unicode2Character()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(2, 4), 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
enjoy it!
相关文章推荐
- Flask 让jsonify返回的json串支持中文显示的方法
- docker 容器中不支持中文的解决方法
- 关于MySQL数据库中不支持中文检索的一个解决方法---个人愚见
- 关于aptana汉化 破解 支持中文 的方法
- 实现fopen支持中文的方法
- tomcat支持中文URI方法
- 关于导入的JS不支持中文的问题解决方法
- STM32 + UCGUI+外扩NAND FLASH 中文字库支持方法
- C#支持中文的格式化字符长度方法
- Mono环境下不支持中文的解决方法
- Mono环境下不支持中文的解决方法
- Mono环境下不支持中文的解决方法
- Mono环境下不支持中文的解决方法
- windows 2003 英文版支持中文显示、中文输入的设置方法
- MySql支持中文的方法
- OPENCV XML函数完美支持中文方法
- Ubuntu系统终端环境支持中文的方法
- Windows下CodeLite支持中文的正确设置方法
- [原创非首发]索爱k700模拟器支持中文显示修改方法
- 解决ubuntu下latex不支持中文的方法