Last modified: 2010-02-10 21:34:04 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T23976, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 21976 - Wikipedia Mobile cannot encode Chinese characters correctly
Wikipedia Mobile cannot encode Chinese characters correctly
Status: RESOLVED FIXED
Product: Wikimedia Mobile
Classification: Unclassified
Retired (Ruby) Gateway (Other open bugs)
.5
All All
: Normal major (vote)
: ---
Assigned To: Hampton Catlin
http://zh.m.wikipedia.org/wiki/%E4%BA...
:
: 21473 21774 22045 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-12-31 11:24 UTC by Liangent
Modified: 2010-02-10 21:34 UTC (History)
6 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Liangent 2009-12-31 11:24:40 UTC
See the bottom of the given page, that "View this page on regular Wikipedia".

http://zh.wikipedia.org/w/mobileRedirect.php?to=http://zh.wikipedia.org/wiki/%26%23x4EA4%3B%26%23x6D41%3B%26%23x96FB%3B

This link is bad.
Comment 1 Derk-Jan Hartman 2009-12-31 11:55:27 UTC
works for me (Safari). What kind of browser are you using ?
Comment 2 Liangent 2009-12-31 12:08:27 UTC
At least it doesn't work for me with Opera Mini (on a smartphone). I took this URL on PC; maybe this URL differs from the one I got with Opera Mini.
Comment 3 Derk-Jan Hartman 2009-12-31 12:42:13 UTC
Tested with Opera Mini and reproducible with Safari.

Page:
http://zh.m.wikipedia.org/wiki/字

Which is the bottom link from http://en.wikipedia.org/wiki/Zi

"View this page" links to: http://zh.wikipedia.org/w/mobileRedirect.php?to=http://zh.wikipedia.org/wiki/%25E5%25AD%2597

This malformed URL lands me on page: http://zh.wikipedia.org/wiki/字

The URL should have been been http://zh.wikipedia.org/wiki/%E5%AD%97
Comment 4 Derk-Jan Hartman 2009-12-31 12:44:05 UTC
%25E5%25AD%2597 decoded == %E5%AD%97 so it's URL encoded twice.
Comment 5 Liangent 2009-12-31 12:51:31 UTC
Its behaviors seem to differ from each other among browsers.
Comment 6 Andrea Di Menna 2010-01-05 11:13:59 UTC
The problem is the following:

# from _footmenu_simple.html.haml

the href for that anchor is retrieved calling -> temp_url(@article.title)
where

    def temp_url(path)
      %|#{redirect_url}?to=#{path_site}/wiki/#{path_encoded(path)}|
    end

and 

    def path_encoded(path)
      CGI::escape(path)
    end

But

path = @article.title is using HTML entities in the form "&#x<hex value>;" and when calling CGI::escape(path) those chars get URL encoded (that is using %<code> form).

Before calling CGI::escape the @article.title should be HTML unescaped (note CGI::unescapeHTML is not working at all).
Maybe you want to check http://po-ru.com/projects/html-entities/
Comment 7 Derk-Jan Hartman 2010-01-05 15:58:42 UTC
*** Bug 21774 has been marked as a duplicate of this bug. ***
Comment 8 Derk-Jan Hartman 2010-01-05 19:21:02 UTC
*** Bug 21473 has been marked as a duplicate of this bug. ***
Comment 9 Derk-Jan Hartman 2010-01-05 19:23:31 UTC
i'll be fixing this. I'll find a way to retrieve the canonical pagename from the javascript options. At least that will be correct and safe.
Comment 10 Derk-Jan Hartman 2010-01-06 18:38:57 UTC
I hope to have fixed this with:

http://bit.ly/6Pb4v6 (not yet deployed)

http://bit.ly/6SAXUG (not yet deployed)
Comment 11 CBM 2010-01-06 18:54:26 UTC
The bit.ly links in the previous comment correspond to:

http://github.com/hcatlin/wikimedia-mobile/commit/79408049e1aa35a07c18cb16aff423ecac834576

http://github.com/hcatlin/wikimedia-mobile/commit/55b503fd49add23863869e30ddf870ce31d2171c

There is plenty of space in Bugzilla to make URL shortening unnecessary. 
Comment 12 Derk-Jan Hartman 2010-01-07 19:26:03 UTC
*** Bug 22045 has been marked as a duplicate of this bug. ***
Comment 13 Derk-Jan Hartman 2010-02-10 21:34:04 UTC
Fix deployed now

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links