The value mw.config.get('wgLegalTitleChars') in the JS interface and the legaltitlechars value from ApiQuerySiteInfo are not same or equivalent.
Running the following in the javascript console:
new mw.Api().get( { "meta": "siteinfo", "siprop": "general" } ).then( function( data ) { console.log( data.query.general.legaltitlechars + '\t\tAPI version' ); console.log( mw.config.get('wgLegalTitleChars') + '\tmw.config version' ); } );
gives:
%!"$&'()*,\-.\/0-9:;=?@A-Z\\^_`a-z~\x80-\xFF+ API version %!"$&'()*,\-./0-9:;=?@A-Z\\\^_`a-z~+\u0080-\uFFFF mw.config version
\xFF isn't the same as \uFFFF, apart from the apparent differences in the number of \ characters used for escaping.
Shouldn't these be the equivalent?
The mw.config version seems to be the correct one. There are some titles such as File:Michał Cieślak Sejm 2016.JPG containing \u0142 and \u015b, which shouldn't be allowed according to the API version.