Created
November 10, 2009 08:36
-
-
Save macks/230744 to your computer and use it in GitHub Desktop.
do_sqlite3 always return ASCII-8BIT string object on Ruby 1.9. (datamapper ticket #1120)
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
# coding: utf-8 | |
# Ruby: 1.9.1p243 (2009-07-16 revision 24175) [i486-linux] | |
# dm-core: 'next' branch | |
# data_objects: 'next' branch | |
require 'dm-core' | |
class Foo | |
include DataMapper::Resource | |
property :id, Serial | |
property :value, String | |
end | |
#DataMapper::Logger.new(STDOUT, :debug) | |
DataMapper.setup(:default, 'sqlite3::memory:') | |
DataMapper.auto_migrate! | |
Foo.create(:value => 'some UTF-8 string: 日本語') | |
p Foo.first.value.encoding.name | |
# => "ASCII-8BIT" | |
# This should be "UTF-8"! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment