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

Vartika
  • 1,085
  • 3
  • 17
  • 43

2 Answers2

2

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

Amit
  • 30,756
  • 6
  • 57
  • 88
  • Sorry but don't have idea about that, I will search for it Still If you can help how we do this on couchdb. – Vartika Apr 11 '17 at 06:44
  • 1
    couchdb seems to be fine, you need to do it in your front-end side or paste the code, how u getting data from couchdb. – Amit Apr 11 '17 at 07:03
  • I have added the server side code and also the jar I am using. I am using currently java 1.8 – Vartika Apr 11 '17 at 07:28
  • there must be some way by which you can specify the encoding while retrieving the data from couchDB. i did it long back and you can do google for that, or have some work-around to convert the string in utf-8. – Amit Apr 11 '17 at 08:09
  • sir, sorry but didnt got anything still working on it – Vartika Apr 11 '17 at 10:52
  • @Vartika , Please avoid using sir , also let me us know what all are u trying – Amit Apr 11 '17 at 11:07
  • Actually i have no idea about these encodings. So just searching – Vartika Apr 11 '17 at 11:11
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/141427/discussion-between-amitk-and-vartika). – Amit Apr 11 '17 at 11:11
0

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

Community
  • 1
  • 1
Vartika
  • 1,085
  • 3
  • 17
  • 43