Retrieving german characters from Etherpad #3075

Open
kernelfreak opened this Issue Nov 9, 2016 · 5 comments

Projects

None yet

3 participants

@kernelfreak
kernelfreak commented Nov 9, 2016 edited

Hello friends,

I am trying to save and retrieve german characters from Etherpad and it's not working well. Lets say I have a text "löschen". When I try to save it, its getting saved, but when retrieving it, I get weird characters back.
When I try to retrieve it, I get back "lC6schen". In settings.json, I have changed the language to de, but that also has not helped. I tried getting html instead of text, then instead of löschen, I get back the HTML operand for 'ö', not very helpful. Why is that etherpad saves something in one way and doesn't translate it back while returning. How can I do it.
I have also tried saving first an empty text, getting the pad-id, adding doc-type, and html, body tags, and saveHTML, but return method still gives me messed up characters.

Below is the way, I am saving and retrieving pads.

public String createPadObjectsForNewNotes(String sessionData, String text){
sessionData=sessionData.replace(""","");
sessionData = sessionData.substring(1, sessionData.length() - 1);
String[] keyValuePairs = sessionData.split(",");
Map map = new HashMap<>();
String str = new BigInteger(130, random).toString(32);
for(String pair : keyValuePairs) {
String[] entry = pair.split(":");
map.put(entry[0].trim(), entry[1].trim());
}
Map pad = client.createGroupPad(String.valueOf(map.get("groupID")), str, text);
if(pad!=null){
return String.valueOf(pad.get("padID"));
}
return null;
}

2nd method to retrieve :

`

public String getTextForGivePad(String padId){
if(client!=null){
Map padObj = client.getHTML(padId);
if(padObj!=null){
return padObj.get("html").toString();
}
}
return null;
}`

How can I solve this problem. Thank you.

@lpagliari
Contributor

If you open the pad on your browser, do you see the correct char on the editor?

@kernelfreak

@lpagliari : No, In CSS preview of the object, I see it correctly as it's retrieved from PostgreSQL DB, but not in Etherpad, that's the actual problem we are facing. Thank you.

@Gared
Member
Gared commented Dec 19, 2016

@kernelfreak Is this text correctly stored in your postgresql database?

@kernelfreak

@Gared Our DB is encrypted, so I cannot be sure.

@Gared
Member
Gared commented Dec 22, 2016

@kernelfreak I'm not familiar with postgresql, but maybe is has something to do with the encoding of your db. What encoding did you configure?
Can you set the log level to "DEBUG" and have a look how your umlauts are being displayed on the CLI/log?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment