Last active
August 29, 2015 14:19
-
-
Save uiur/a03e553c20de1ef1da28 to your computer and use it in GitHub Desktop.
euc-jp -> utf-8
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
require 'json' | |
list = Dir.glob('wiki/*.txt').map do |path| | |
title = `echo #{path} | xxd -r -p | nkf -E -w` | |
body = `cat #{path} | nkf -E -w` | |
{ | |
title: title, | |
body: body | |
} | |
end | |
puts JSON.pretty_generate(list) |
Author
uiur
commented
Apr 20, 2015
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment