https://bugzilla.wikimedia.org/show_bug.cgi?id=31918

Krinkle <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[email protected]

--- Comment #9 from Krinkle <[email protected]> 2012-07-22 07:15:17 UTC ---
(In reply to comment #8)
> I see three possibilities to solve the problem
> 
> * Implement in JavaScript the same decoder like in PHP. So
> mw.util.getParamValue() tries to decode as ISO 8859-1 when UTF-8 decoding
> fails.

There are more encodings, and this can depends on the configuration of the
server as well.

> * MediaWiki answers with 301 Moved Permanently and Location in UTF-8 encoding.
> So the URL gets normalized.

Not desired or possible in certain cases.

> * The parameters gets normalized in PHP and transfered to JavaScript via wiki
> global variable. mw.util.getParamValue() use the normalized parameters from
> this variable instead of the URL.

Unnecessary bloat.

And all these 3 solutions share the same problem: They encourage usage of query
created and targeted for one script – outside that script (namely a gadget or
something). Which is bad, because these are not documented or considered
stable. Query parameter names and meaning may change at any time, and must only
be used for communication between the script's output and input to itself.

Solution 4.: Relevant values are exported to javascript in a canonical way by
the script. For example MediaWiki itself always exports wgTitle,
wgNamespaceNumber etc. And special pages export wgCanonicalSpecialPageName.
Other scripts can export their own information (e.g. SpecialContributions could
export `spContributionsTarget: ..` or `spContributions: { target: .. }`.).

-- 
Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
You are on the CC list for the bug.
_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to