On 26/08/10 10:44, Tgr wrote:
> lampak<llampak<at>  gmail.com>  writes:
>
>> I have tried encodeURIComponent before. Bażant królewski becomes
>> Bażant_królewski. Diacritics are not converted. At least not under Firefox.
>
> I don't know what you've tried, but the result of
>
> encodeURIComponent('Bażant królewski')
>
> is
>
> "Ba%C5%BCant%20kr%C3%B3lewski"
>
> in Firefox, and I'm pretty sure it works the same way on other browsers.
> (encodeURI is almost the same, but leaves more characters unencoded, which in
> this case is a bad thing.)
>
> Then you need to replace %20 with _, % with ., unencoded characters ~!*()' 
> with
> their proper utf-8 sequence, and you have the section title fragment.
>
> (It might be a good idea to include a function doing that in wikibits.js, if
> there isn't one yet.)
Ah, indeed. That's because I put it directly to the window.location and 
then on the address bar these utf codes transformed into ż and ó. Thanks :)

lampak


_______________________________________________
Wikitech-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l

Reply via email to