Last modified: 2008-07-11 18:13:46 UTC

Wikimedia Bugzilla is closed!

Wikimedia has migrated from Bugzilla to Phabricator. Bug reports should be created and updated in Wikimedia Phabricator instead. Please create an account in Phabricator and add your Bugzilla email address to it.
Wikimedia Bugzilla is read-only. If you try to edit or create any bug report in Bugzilla you will be shown an intentional error message.
In order to access the Phabricator task corresponding to a Bugzilla report, just remove "static-" from its URL.
You could still run searches in Bugzilla or access your list of votes but bug reports will obviously not be up-to-date in Bugzilla.
Bug 8604 - padright: and similar functions fail with non-ASCII arguments
padright: and similar functions fail with non-ASCII arguments
Product: MediaWiki
Classification: Unclassified
Parser (Other open bugs)
All All
: Normal normal (vote)
: ---
Assigned To: Nobody - You can work on this!
Depends on:
Blocks: unicode
  Show dependency treegraph
Reported: 2007-01-12 13:46 UTC by Alon Lischinsky
Modified: 2008-07-11 18:13 UTC (History)
1 user (show)

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


Description Alon Lischinsky 2007-01-12 13:46:43 UTC
When given a non-ASCII filler, padright: and its kin apply the right number of
an incorrect element (see [[:meta:User:Taragui#Padright test]] for an example.

Handling of Unicode seems broken in any case: non-ASCII characters in the first
argument are counted '''according to their byte length''' (i.e., as 2 to 4
characters) instead of as one each, as they should. This breaks the fix for the
unavailability of a <code>strlen</code> function proposed at
[[:meta:Talk:ParserFunctions#strlen & substr]].
Comment 1 Aryeh Gregor (not reading bugmail, please e-mail directly) 2007-01-12 18:49:37 UTC
This doesn't break that fix, because that probably would have done byte count too.  Note that 
Unicode characters can also be visually less than one character, e.g., combining or zero-width 
characters (although admittedly those are rarer).
Comment 2 Antoine "hashar" Musso (WMF) 2007-01-13 13:10:13 UTC
Language::pad use strlen() whereas we should use mb_strlen()
(and code a function if mbstring is not loaded)
Comment 3 Niklas Laxström 2008-07-11 18:13:46 UTC
Fixed the pad functions in r37567. Were there any others?

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