How to save double-byte characters in mongodb?

I have a Model called Review.rb

class MovieNews::Review
include Mongoid::Document
include Mongoid::Timestamps
include Mongoid::Userstamp
include Mongoid::Search

    field :story,   type: Stringend

When i create a instance of class review and tried saving which local
language telugu in the field, im getting wrong output.

Ex1:

review = MovieNews::Review.new
review.story = “నటవర్గం” after pasting here it’s spelling goes worng
“నటవర్…”
review.save => true

Does Mongodb supports local languages to create collection? Someone
please
help me out.

On Thursday, July 9, 2015 at 9:47:00 AM UTC+1, Kiran K. wrote:

Are you saying that data saved to mongo comes back incorrect or that
it’s
the pasting in your text editor (or possibly the ruby console) that
doesn’t
work?

Fred

On Thursday, 9 July 2015 04:47:00 UTC-4, Kiran K. wrote:

help me out.

As Fred has indicated, is the issue that the string appears incorrectly in
the terminal / editor, or that it is saved incorrectly to the database?
I
was able to produce a string that looks (to my
thoroughly-unfamiliar-with-Telegu-script eyes) like your “spelling goes
wrong” example by replacing the last six bytes of the string with two
literal periods (codepoint U+2E).

–Matt J.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs