I use the MediaWiki API to refresh some pages with an experimental robot. This robot uses the Apache Java Java client library to refresh pages.
(...)
PostMethod postMethod = new PostMethod("http://mymediawikiinstallation/w/api.php");
postMethod.addParameter("action","edit");
postMethod.addParameter("title",page.replace(' ', '_'));
postMethod.addParameter("summary","trying to fix this accent problem");
postMethod.addParameter("text",content);
postMethod.addParameter("basetimestamp",basetimestamp);
postMethod.addParameter("starttimestamp",starttimestamp);
postMethod.addParameter("token",token);
postMethod.addParameter("notminor","");
postMethod.addParameter("format","xml");
int status = httpClient.executeMethod(postMethod);
(...)
However, the string "content" contains some accents. System.out.prinln(content)It looks fine, but accented characters on the wiki look bad. For example. "Val rie" instead of "Valérie".
How can i fix this?
source
share