BaseSite.urlEncode is deprecated, and uses urlencode(query) as its implementation. This doesnt appear to be backwards compatible, as the compat code would re-order the argsThe method `BaseSite.urlEncode` from #pywikibot-compat was copied to #pywikibot-core as deprecated, and do utf8 `core` uses `urlencodinge` as its implementation.
Ideally we build some unit tests that pass on compatn the compat , BaseSite.urlEncode moved `wpEditToken` to the last arg as recommended by the API documentation, and it did utf8 encoding.
POST parameter encoding in `core` is now performed mostly in `pywikibot.data.api.Request`. This class does encoding properly, but fail on coredoes not re-order the parameters. To fix this, and find an implementation that is backwards compatibley parameter named '*token' should be moved to the end.
The deprecated `BaseSite.urlEncode` in core also needs to be updated so it is backwards compatible.
Tests need to be created to verify that `pywikibot.data.api.Request` and `BaseSite.urlEncode` re-order parameters, or copy the code from compat.and very basic tests are needed to verify that `BaseSite.urlEncode` encodes the parameters correctly.