Created
November 7, 2020 11:59
-
-
Save hideack/17816edb1536b07bdc461933ae2914d5 to your computer and use it in GitHub Desktop.
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
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