MediaWiki REL1_33
generatePhpCharToUpperMappings.php
Go to the documentation of this file.
1#!/usr/bin/env php
2<?php
13$data = [];
14
15// phpcs:disable MediaWiki.Usage.ForbiddenFunctions.exec
16$jsUpperChars = json_decode( exec( 'node generateJsToUpperCaseList.js' ) );
17// phpcs:enable MediaWiki.Usage.ForbiddenFunctions.exec
18
19for ( $i = 0; $i < 65536; $i++ ) {
20 if ( $i >= 0xd800 && $i <= 0xdfff ) {
21 // Skip surrogate pairs
22 continue;
23 }
24 $char = mb_convert_encoding( '&#' . $i . ';', 'UTF-8', 'HTML-ENTITIES' );
25 $phpUpper = mb_strtoupper( $char );
26 $jsUpper = $jsUpperChars[$i];
27 if ( $jsUpper !== $phpUpper ) {
29 }
30}
31
32echo str_replace( ' ', "\t",
33 json_encode( $data, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE )
34) . "\n";
and that you know you can do these things To protect your we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights These restrictions translate to certain responsibilities for you if you distribute copies of the or if you modify it For if you distribute copies of such a whether gratis or for a you must give the recipients all the rights that you have You must make sure that receive or can get the source code And you must show them these terms so they know their rights We protect your rights with two and(2) offer you this license which gives you legal permission to copy
$data
Utility to generate mapping file used in mw.Title (phpCharToUpper.json)