You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
UTF8 characters - Latin Diacritics are not rendering properly #63
I checked the output of the REST API call from the browser, it is showing Latin Diacritics properly, however, the string returned from com.afrozaar.wordpress.wpapi.v2.model.Post.getContent().getRendered() contains an invalid string with the special characters appearing as ?.
It should be an easy fix for the author, I believe somewhere the conversion is not happening properly. I will try to fix it and submit a PR but please do check.
Update
I was able to fix this. You need to slightly edit the file
com.afrozaar.wordpress.wpapi.v2.Client.java:127 Before
restTemplate = new RestTemplate(messageConverters);
After
import java.nio.charset.StandardCharsets;
....
restTemplate = new RestTemplate(messageConverters);
restTemplate.getMessageConverters()
.add(0, new StringHttpMessageConverter(StandardCharsets.UTF_8));
It is a very simple change, I have never submitted a PR actually, may be the authors can fix this on their own. If a PR is required let me know, I will submit one. For now, this solves my problem.
Activity
nithyasharabheshwara commentedon Apr 11, 2022
@michaelwiles @clintonbosch
Fixed UTF8 chars