Created
December 6, 2013 06:23
-
-
Save toshiyukino/7819403 to your computer and use it in GitHub Desktop.
VBAでユニコードエスケープされた文字を復元.意外と短くできた
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sub test() | |
Set re = CreateObject("VBScript.RegExp") | |
re.Pattern = "\\u([a-fA-F0-9]{4})" | |
re.Global = True | |
re.IgnoreCase = True | |
re.MultiLine = True | |
a = "\u3042\u3044\u3046\u3048\u304A" 'あいうえお | |
Set mc = re.Execute(a) | |
For Each m In mc | |
For Each s In m.submatches | |
a = Replace(a, "\u" & s, ChrW("&h" & s)) | |
Next | |
Next | |
MsgBox a | |
End Sub |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment