Created
October 8, 2018 14:05
-
-
Save patte/22f04bd9b4ec688a6a4183811ddbd28c to your computer and use it in GitHub Desktop.
fix UTF8 combining diaeresis
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
//https://www.fileformat.info/info/unicode/char/0308/index.htm | |
//https://vi.stackexchange.com/questions/3557/can-i-search-for-a-unicode-combining-character-in-vim | |
const fs = require('fs') | |
const path = __dirname+'/article.md' | |
const buffer = fs.readFileSync(path) | |
const fixed = buffer.toString('utf8') | |
.replace(/a\u0308/g, 'ä') | |
.replace(/u\u0308/g, 'ü') | |
.replace(/o\u0308/g, 'ö') | |
fs.writeFileSync(path+'-new', fixed) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment