Last modified: 2014-04-18 17:49:47 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 T54632, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 52632 - Pull request: fix for not being able to install without mb_convert_encoding function
Pull request: fix for not being able to install without mb_convert_encoding f...
Status: RESOLVED WONTFIX
Product: MobileFrontend
Classification: Unclassified
Feature requests (Other open bugs)
unspecified
All All
: Low enhancement
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-08-08 06:01 UTC by SiPlus
Modified: 2014-04-18 17:49 UTC (History)
10 users (show)

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


Attachments

Description SiPlus 2013-08-08 06:01:59 UTC
The extension doesn't work (gives fatal error) if PHP is compiled without multibyte string functions, specifically mb_convert_encoding.

Here's a patch.

In /includes/HtmlFormatter.php, in the root class, add:

/*
* Converts UTF-8 characters to HTML entities
* @param string $string: The string to convert
* @return string: The converted string
*/
public function convertToHtmlEntities( $string ) {
	if ( function_exists ( 'mb_convert_encoding' ) ) {
		return mb_convert_encoding( $string, 'HTML-ENTITIES', 'UTF-8' );
	}
	return htmlspecialchars_decode( utf8_decode( htmlentities( $string ) ) );
}

In getDoc function, replace
$html = mb_convert_encoding( $this->html, 'HTML-ENTITIES', "UTF-8" );
with
$html = $this->convertToHtmlEntities( $this->html );

And in fixLibXML, replace
$html = mb_convert_encoding( $html, 'UTF-8', 'HTML-ENTITIES' );
with
$html = $this->convertToHtmlEntities( $html );
Comment 1 Max Semenik 2013-08-19 20:36:39 UTC
Wouldn't utf8_decode() mangle everything not supported by ISO-8859-1?
Comment 2 SiPlus 2013-08-20 08:14:17 UTC
Oh, yes.
Can you tell me how do I see what does a string look like internally in PHP? Using echo, I get the same result for my test with and entirely without mb_convert_encoding.
Comment 3 Jon 2014-01-08 01:35:02 UTC
Max what is the status of this bug?
Comment 4 Jon 2014-04-18 17:39:40 UTC
Max..? Is this something we should be working on?
Comment 5 Max Semenik 2014-04-18 17:49:47 UTC
MediaWiki works horribly slow without proper Unicode support, I don't think we should support this use case.

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


Navigation
Links