FireFox URL encoding

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

FireFox URL encoding

Maxim Votyakov
Hello mediawiki-l,

I have my own wiki http://towiki.ru/ powered by MediaWiki, it's a
CityWiki for Tomsk. It works fine in IE and Opera, but I have one
problem in Firefox:

if I try to open URL (codepage in Windows is Russian: Windows-1251):
http://towiki.ru/view/Асино

FireFox tries to retrieve incorrect URL:
http://towiki.ru/view/%C3%80%C3%B1%C3%A8%C3%AD%C3%AE

but correct URL is:
http://towiki.ru/view/%D0%90%D1%81%D0%B8%D0%BD%D0%BE

It is because FireFox setting network.standard-url.encode-utf8 by
default is set to false, see
http://kb.mozillazine.org/Network.standard-url.encode-utf8

If I change in about:config network.standard-url.encode-utf8 to true,
FireFox also works, but it is not a solution because everybody have
this parameter switched to false.

BUT in ru-Wikipedia http://ru.wikipedia.org/wiki/Асино
even with network.standard-url.encode-utf8=false
gives http://ru.wikipedia.org/wiki/%D0%90%D1%81%D0%B8%D0%BD%D0%BE
so all works correct.

My question is - why it works correct in Wikipedia and how I can do
the same for my wiki?

Thank you very much for your help!

--
Best regards,
 Maxim                          mailto:[hidden email]


_______________________________________________
MediaWiki-l mailing list
[hidden email]
http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
Reply | Threaded
Open this post in threaded view
|

Re: FireFox URL encoding

Alexis Moinet
Maxim a écrit :
> if I try to open URL (codepage in Windows is Russian: Windows-1251):
> http://towiki.ru/view/Асино
>
> FireFox tries to retrieve incorrect URL:
> http://towiki.ru/view/%C3%80%C3%B1%C3%A8%C3%AD%C3%AE
>
> but correct URL is:
> http://towiki.ru/view/%D0%90%D1%81%D0%B8%D0%BD%D0%BE
 >
 > It is because FireFox setting network.standard-url.encode-utf8 by
 > default is set to false, see
 > http://kb.mozillazine.org/Network.standard-url.encode-utf8

My Firefox 2.0 (with network.standard-url.encode-utf8 set to false) opens the good one (click on http://towiki.ru/view/Асино opens url : http://towiki.ru/view/%D0%90%D1%81%D0%B8%D0%BD%D0%BE).

Did you change something ?


_______________________________________________
MediaWiki-l mailing list
[hidden email]
http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
Reply | Threaded
Open this post in threaded view
|

Re: FireFox URL encoding

Maxim Votyakov
Hello Alexis,

Thank you for your answer. But I still have the problem on my side. I
guees you have non-Russian default locale.
If I switch Default locale = English (United States) then it also works fine, but in
Russia all users have Default locale = Russian, that's a problem.

In ru.wikipedia.org all works fine, but on my site it does not :(

May be there are some special web-server settings on Wikipedia sites?

Thursday, March 29, 2007, 3:42:23 PM, you wrote:

AM> Maxim a ecrit :
>> if I try to open URL (codepage in Windows is Russian: Windows-1251):
>> http://towiki.ru/view/Асино
>>
>> FireFox tries to retrieve incorrect URL:
>> http://towiki.ru/view/%C3%80%C3%B1%C3%A8%C3%AD%C3%AE
>>
>> but correct URL is:
>> http://towiki.ru/view/%D0%90%D1%81%D0%B8%D0%BD%D0%BE
 >>
 >> It is because FireFox setting network.standard-url.encode-utf8 by
 >> default is set to false, see
 >> http://kb.mozillazine.org/Network.standard-url.encode-utf8

AM> My Firefox 2.0 (with network.standard-url.encode-utf8 set to
AM> false) opens the good one (click on http://towiki.ru/view/Асино
AM> opens url : http://towiki.ru/view/%D0%90%D1%81%D0%B8%D0%BD%D0%BE).

AM> Did you change something ?


AM> _______________________________________________
AM> MediaWiki-l mailing list
AM> [hidden email]
AM> http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
 



--
Best regards,
 Maxim                            mailto:[hidden email]


_______________________________________________
MediaWiki-l mailing list
[hidden email]
http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
Reply | Threaded
Open this post in threaded view
|

Re: FireFox URL encoding

Brion Vibber-3
In reply to this post by Maxim Votyakov
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Maxim wrote:

> I have my own wiki http://towiki.ru/ powered by MediaWiki, it's a
> CityWiki for Tomsk. It works fine in IE and Opera, but I have one
> problem in Firefox:
>
> if I try to open URL (codepage in Windows is Russian: Windows-1251):
> http://towiki.ru/view/Асино
>
> FireFox tries to retrieve incorrect URL:
> http://towiki.ru/view/%C3%80%C3%B1%C3%A8%C3%AD%C3%AE
>
> but correct URL is:
> http://towiki.ru/view/%D0%90%D1%81%D0%B8%D0%BD%D0%BE

In order to convert incoming URLs that aren't UTF-8, MediaWiki needs to
do two things:

First, it needs to know what encoding to convert from. This is a guess
of most likely non-UTF-8 encoding based on the set up content language;
for Russian I believe we try Windows-1251.

Second, it needs to actually be able to do the conversion from that to
UTF-8. Conversions are done using iconv() if it's available as a PHP
module (not enabled by default).

But... if this module is not present, then the only conversion available
is utf8_encode() which converts only from ISO 8859-1 (Latin-1). This I
believe will produce the results you describe.

See if you can enable the iconv module for PHP; that should be able to
fix the conversion (double-check for cached redirects after making the
change).

Alternatively it may be possible to rig up a fallback conversion
function using a hardcoded table, or maybe mb_convert_encoding if that's
also available.

- -- brion vibber (brion @ wikimedia.org)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGC9ccwRnhpk1wk44RAqx2AKCAaT8yjmhfxuOI7opIPYEG2YifxQCeNs8z
NT7n66HdoWfo1dKUM+S/J1s=
=nOeG
-----END PGP SIGNATURE-----

_______________________________________________
MediaWiki-l mailing list
[hidden email]
http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
Reply | Threaded
Open this post in threaded view
|

Re: FireFox URL encoding

Maxim Votyakov
Hello Brion,

Thursday, March 29, 2007, 10:11:24 PM, you wrote:

BV> See if you can enable the iconv module for PHP; that should be able to
BV> fix the conversion (double-check for cached redirects after making the
BV> change).

It works, thank you very much!

--
Best regards,
 Maxim                            mailto:[hidden email]


_______________________________________________
MediaWiki-l mailing list
[hidden email]
http://lists.wikimedia.org/mailman/listinfo/mediawiki-l