Vartika
Vartika

Reputation: 1095

Get Hindi data from Apache CouchDB 1.6.1

I am using Apache CouchDB 1.6.1 as my database. We are creating quiz and saving the question data in couchdb. Now, there are users who want to create question in hindi. Data gets saved in couchdb easily but on retrieval of the data from couchdb its get converted into some absurd font. May be there is some issue with the font family and all I am unaware of all this.

We are using Java with Gwt in our project.

COuchdb Sample Db Img

Data On fetching

 public String getData(){
        Session session = new Session("192.168.1.70", 5984);
        String hindiresult=null;
        try{
            Database test = session.getDatabase("test");
            Document testdoc = test.getDocument("testdoc");
            hindiresult=testdoc.getString("hindifield");

        }catch(Exception e){
            e.printStackTrace();
        }
        return hindiresult;
    }
}

This is our server side code fetching data here and returning it to client on alert. The Image I have already shared. Jar Using

Upvotes: 1

Views: 116

Answers (2)

Vartika
Vartika

Reputation: 1095

I just changed the encoding of the Eclipse Ide suggested in the following question from default to utf-8. HELPFUL LINK

Upvotes: 0

Amit
Amit

Reputation: 32386

You need to use utf-8 encoding, to support hindi.

Upvotes: 2

Related Questions