Issue #10111 has been updated by Akira Tanaka. Status changed from Open to Rejected gdbm (and dbm) doesn't record encoding. So, current behavior is natural and not a bug, I think. ---------------------------------------- Bug #10111: gdbm truncated UTF-8 data problem https://bugs.ruby-lang.org/issues/10111#change-52104 * Author: KiHyun Kang * Status: Rejected * Priority: Normal * Assignee: Aaron Patterson * ruby -v: ruby 2.1.2p95 (2014-05-08 revision 45877) [x86_64-linux] * Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN ---------------------------------------- Reproducible script is here. ~~~ # coding: utf-8 require 'gdbm' data = "\xEA\xB0\x80ABCDEF" db = GDBM.new( 'test.db', 0666 ) db['key'] = data throw 'data truncated!!' if db['key'] != data ~~~ -- https://bugs.ruby-lang.org/