eth.setHTML(padId, html) accent issue
When a new pad is created and then use the setHTML method to include some text with accents (e.g. ción ción) shows like this
When i edit the same pad, accents are accepted and saved correctly

What database are you using? Looks like encoding issues. AFAIK using a browser seems to be okay, because internally all db-interaction is cached. When you are typing you see what you type. On reload you will be served data from the db cache if it is still there.
To be really sure the cache is cleared you need to restart the server. If I am correct, the first line in your second image should be wrong after that.
After the refresh i can check that the first line in the second image has accents. The database stores it correctly. I'm thinking about the encoding of the request from the backend when i create the pad. There's a header in the API to set it as a parameter or something?
We are still having this issue @webzwo0i Do you have any news on this?
Any news regarding this issue?
We have experienced the same problem on our side aswell. It is not only for setHTML. It is also for setting the default text in the createGroupPad method aswell. We are using the Java API to connect with the node.js server. Can someone of the developer try to create a pad with one of those characters over the api and explain why this encoding issue happens? ö, ä, ü, ß
The problem is that the HTML need to be sent encoded to the API. The Ruby API does that (I'm not getting the same issues you are, so I was puzzled about that and started investigating), maybe the Java one does not.
Using curl without encoding:
curl "http://my.instance.com/api/1.2.13/setHTML?apikey=secret&padID=test&html=<html><head></head><body>ß</body></html>"
Result:

Now curl + encoding:
curl "http://my.instance.com/api/1.2.13/setHTML?apikey=secret&padID=test&html=<html><head></head><body>%C3%9F</body></html>"
Result:

Hope this helps.
Can anyone tell me what do you guys mean by encoding plain text before saving it in Java? Thanks.
@kernelfreak you don't need to save anything, you just need to transform the text you are sending to the Etherpad client.
This should actually be handled on the Java client (more precisely here), but if you don't want to wait for them to fix it, you can handle the text encoding yourself:
import java.net.URLEncoder;
(...)
EPLiteClient client = new EPLiteClient("http://localhost:9001", "K8OF91QMQYUvrNu3e9rJ7FnnVgaB3m9q");
String originalText = "ö, ä, ü, ß";
String encodedText = URLEncoder.encode(originalText, "UTF-8");
client.setText("my_pad", encodedText);
@javierpf @cdparra are you using the Java client too?
@lpagliari yes, we are using the Java client. I will try your solution Today and see if it works (I can trie to do it directly in the client code and then submit a pull request)
I can trie to do it directly in the client code and then submit a pull request
Perfect! That would be even better. Thanks!
Just tried this out and it works. I created a pull request for the java-etherpad-client I am using (not sure if there is another one)
I encoded the text with URLEncoder.encode("text","UTF-8") and then it worked. Thank you.