Created
November 7, 2020 11:59
-
-
Save hideack/e93aace98d15bd1435cf1b034ae89025 to your computer and use it in GitHub Desktop.
shiftjis.js
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
let files = event.target.files; // ここはファイル選択だったりドラッグ&ドロップのイベントだったりで変わる | |
let reader = new FileReader(); | |
reader.readAsBinaryString(files[0]); | |
reader.onload = (ev) => { | |
const unicodeList = reader.result.split('').map((v) => v.charCodeAt()); | |
const uploadText = Encoding.convert(unicodeList, {to:'UNICODE', from:Encoding.detect(unicodeList), type:'string'}); | |
console.log(uploadText); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment