The project is in a healthy, maintained state
Automatically detects and converts various Japanese CSV encodings to UTF-8 safely.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies

Runtime

~> 0.2.0
 Project Readme

CsvEncodingHelper

A Ruby gem that automatically detects and converts CSV file encodings (UTF-8, UTF-16LE/BE, Shift_JIS, EUC-JP, ISO-2022-JP) into UTF-8.

Installation

Add this line to your application's Gemfile:

gem "csv_encoding_helper"

And then execute:

bundle install

Or install it yourself:

gem install csv_encoding_helper

Usage

require "csv_encoding_helper"

file = File.binread("sjis.csv")
uft8_text = CsvEncodingHelper::Decoder.decode(file)
CSV.parse(utf8_text, headers: true)