Created
April 20, 2016 12:20
-
-
Save gazhikaba/fd28f8935aa2da08e6667b4b2a107a78 to your computer and use it in GitHub Desktop.
VBA
This file contains hidden or 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
| .LineSeparator | |
| Function SJIS_to_UTF8(FN As String) | |
| 引数「FN」にファイルのフルパスを入れます。 | |
| Dim FROM_OBJ As Object | |
| Dim TO_OBJ As Object | |
| Set FROM_OBJ = CreateObject("ADODB.Stream") | |
| With FROM_OBJ | |
| .Type = 2 | |
| .Charset = "shift-jis" | |
| .Open | |
| .LoadFromFile FN | |
| .LineSeparator = 10 '10:LF 13:CR -1:CRLF | |
| .Position = 0 | |
| End With | |
| Set TO_OBJ = CreateObject("ADODB.Stream") | |
| With TO_OBJ | |
| .Type = 2 | |
| .Charset = "utf-8" | |
| .Open | |
| End With | |
| FROM_OBJ.copyto TO_OBJ | |
| TO_OBJ.Position = 0 | |
| TO_OBJ.savetofile FN & "_utf.txt", 2 | |
| End Function |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment