I found that at least one UTF-8 character is not supported by
mongo_ext (0.18.1). It's the very first one: "\x00"
http://www.utf8-chartable.de/unicode-utf8-table.pl?utf8=string-literal&view=3
$KCODE = 'u'
char = "\x00"
document = {:_id => rand(999999999), :content => char}
id = collection.save(document)
collection.find({:_id => id}).to_a # => <TypeError: no c decoder for
this type yet (0)>
I know it can be considered as an edge case, but it's common to see
"=00" quoted printable strings in emails (which is concerted to "\x00"
by unpack("M*")).
It worked fine with the next 2047 utf-8 characters, see http://pastie.org/747024
Nicolas
> > >>mongo_extshouldn't be allowing you to insert bad data to begin with.
> > >> will take a look at your test case
>
> > >> On Mon, Nov 30, 2009 at 11:53 AM, Nicolas Fouché <nico...@silentale.com> wrote:
> > >> > Hi,
>
> > >> > following the discussion about unreadable objects in the database
> > >> >http://groups.google.com/group/mongodb-user/browse_thread/thread/4e3a...,
> > >> > I found a problem with the C extension of the Ruby driver.
>
> > >> > Here is a code snippet to reproduce the problem:http://pastie.org/720325
>
> > >> > So it seems thatmongo_extcan insert anything but cannot read it.