diff --git a/activerecord/CHANGELOG b/activerecord/CHANGELOG index bf3a893e7f..38f21e2d04 100644 --- a/activerecord/CHANGELOG +++ b/activerecord/CHANGELOG @@ -1,5 +1,7 @@ *SVN* +* SQLite: binary escaping works with $KCODE='u'. #7862 [tsuka] + * Base#to_xml supports serialized attributes. #7502 [jonathan] * Base.update_all :order and :limit options. Useful for MySQL updates that must be ordered to avoid violating unique constraints. [Jeremy Kemper] diff --git a/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb b/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb index da4efd394f..2c4e63b87d 100644 --- a/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb @@ -68,7 +68,7 @@ module ActiveRecord class SQLiteColumn < Column #:nodoc: class << self def string_to_binary(value) - value.gsub(/\0|\%/) do |b| + value.gsub(/\0|\%/n) do |b| case b when "\0" then "%00" when "%" then "%25" @@ -77,7 +77,7 @@ module ActiveRecord end def binary_to_string(value) - value.gsub(/%00|%25/) do |b| + value.gsub(/%00|%25/n) do |b| case b when "%00" then "\0" when "%25" then "%"