從臉書粉專下載的 JSON 資料格式長這樣

{
  "name": "2016~2017 \u00e5\u00ae\u00a2\u00e8\u00a8\u0082\u00e4\u00bd\u009c\u00e5\u0093\u0081\u00e8\u00a8\u0098\u00e9\u008c\u0084\u00ef\u00bc\u0088\u00e6\u0096\u00b0->\u00e8\u0088\u008a\u00ef\u00bc\u0089"
}

中文字元以 unicode 的方式編碼,因此直接丟進 JSON.parse 依舊解不出來,透過以下方式即可解決。

JSON.parse(IO.read(file).gsub(/\\u00([a-f0-9]{2})/) { |_m| Regexp.last_match(1).to_i(16).chr })

參考資料: https://sorashi.github.io/fix-facebook-json-archive-encoding/