|
2 | 2 | test if bind_textdomain_codeset() returns correct value |
3 | 3 | --EXTENSIONS-- |
4 | 4 | gettext |
| 5 | +--CREDITS-- |
| 6 | +Florian Holzhauer [email protected] |
| 7 | +PHP Testfest Berlin 2009-05-09 |
5 | 8 | --FILE-- |
6 | 9 | <?php |
7 | | - try { |
8 | | - bind_textdomain_codeset(false,false); |
9 | | - } catch (ValueError $e) { |
10 | | - echo $e->getMessage() . PHP_EOL; |
11 | | - } |
12 | | - |
13 | | - try { |
14 | | - bind_textdomain_codeset("", "UTF-8"); |
15 | | - } catch (ValueError $e) { |
16 | | - echo $e->getMessage() . PHP_EOL; |
17 | | - } |
| 10 | +try { |
| 11 | + bind_textdomain_codeset("", "UTF-8"); |
| 12 | +} catch (ValueError $e) { |
| 13 | + echo $e->getMessage() . PHP_EOL; |
| 14 | +} |
18 | 15 |
|
19 | | - // bind_textdomain_codeset() always returns false on musl |
20 | | - // because musl only supports UTF-8. For more information: |
21 | | - // |
22 | | - // * https://github.com/php/doc-en/issues/4311, |
23 | | - // * https://github.com/php/php-src/issues/17163 |
24 | | - // |
25 | | - $result = bind_textdomain_codeset('messages', "UTF-8"); |
26 | | - var_dump($result === false || $result === "UTF-8"); |
| 16 | +// bind_textdomain_codeset() always returns false on musl |
| 17 | +// because musl only supports UTF-8. For more information: |
| 18 | +// |
| 19 | +// * https://github.com/php/doc-en/issues/4311, |
| 20 | +// * https://github.com/php/php-src/issues/17163 |
| 21 | +// |
| 22 | +$result = bind_textdomain_codeset('messages', "UTF-8"); |
| 23 | +var_dump($result === false || $result === "UTF-8"); |
27 | 24 |
|
28 | | - echo "Done\n"; |
| 25 | +echo "Done\n"; |
29 | 26 | ?> |
30 | 27 | --EXPECT-- |
31 | 28 | bind_textdomain_codeset(): Argument #1 ($domain) must not be empty |
32 | | -bind_textdomain_codeset(): Argument #1 ($domain) must not be empty |
33 | 29 | bool(true) |
34 | 30 | Done |
35 | | ---CREDITS-- |
36 | | -Florian Holzhauer [email protected] |
37 | | -PHP Testfest Berlin 2009-05-09 |
0 commit comments