Index: trunk/phase3/includes/api/ApiResult.php |
— | — | @@ -186,6 +186,15 @@ |
187 | 187 | ApiResult :: setElement($data, $name, $value); // Add named element |
188 | 188 | } |
189 | 189 | |
| 190 | + /** |
| 191 | + * Ensure all values in this result are valid UTF-8. |
| 192 | + */ |
| 193 | + public function cleanUpUTF8() |
| 194 | + { |
| 195 | + $data = & $this->getData(); |
| 196 | + array_walk_recursive($data, array('UtfNormal', 'cleanUp')); |
| 197 | + } |
| 198 | + |
190 | 199 | public function execute() { |
191 | 200 | ApiBase :: dieDebug(__METHOD__, 'execute() is not supported on Result object'); |
192 | 201 | } |
Index: trunk/phase3/includes/api/ApiMain.php |
— | — | @@ -438,6 +438,7 @@ |
439 | 439 | * Print results using the current printer |
440 | 440 | */ |
441 | 441 | protected function printResult($isError) { |
| 442 | + $this->getResult()->cleanupUTF8(); |
442 | 443 | $printer = $this->mPrinter; |
443 | 444 | $printer->profileIn(); |
444 | 445 | |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -50,6 +50,7 @@ |
51 | 51 | * (bug 16858) Revamped list=deletedrevs to make listing deleted contributions |
52 | 52 | and listing all deleted pages possible |
53 | 53 | * (bug 16844) Added clcategories parameter to prop=categories |
| 54 | +* (bug 15261, 16262) API no longer outputs invalid UTF-8 |
54 | 55 | |
55 | 56 | === Languages updated in 1.15 === |
56 | 57 | |