1--TEST-- 2Thai UTF-8 basic test 3--SKIPIF-- 4<?php 5include dirname(__FILE__) . DIRECTORY_SEPARATOR . "util.inc"; 6 7skip_if_not_win(); 8if (getenv("SKIP_SLOW_TESTS")) die("skip slow test"); 9skip_if_no_required_exts(); 10 11?> 12--FILE-- 13<?php 14/* 15#vim: set fileencoding=cp874 16#vim: set encoding=cp874 17*/ 18 19include dirname(__FILE__) . DIRECTORY_SEPARATOR . "util.inc"; 20 21$names = array( /* cp874 */ 22 "�������跴�ͺ1", 23 "�������跴�ͺ2", 24 "�������跴�ͺ3", 25 "�������跴�ͺ4", 26 "�������跴�ͺ5", 27 "�������跴�ͺ6", 28 "�������跴�ͺ7", 29 "�������跴�ͺ8", 30 "�������跴�ͺ8 10", 31); 32 33$i = 0; 34foreach ($names as $name) { 35 $pathw = dirname(__FILE__) . DIRECTORY_SEPARATOR . iconv('cp874', 'utf-8', $name) . ".txt"; 36 37 file_put_contents($pathw, "hello" . $i++); 38 39 get_basename_with_cp($pathw, 65001); 40 var_dump(file_get_contents($pathw)); 41 42 unlink($pathw); 43} 44 45?> 46===DONE=== 47--EXPECTF-- 48Active code page: %d 49getting basename of %sเป็นแฟ้มที่ทดสอบ1.txt 50string(%d) "เป็นแฟ้มที่ทดสอบ1.txt" 51bool(true) 52string(%d) "%sเป็นแฟ้มที่ทดสอบ1.txt" 53Active code page: %d 54string(6) "hello0" 55Active code page: %d 56getting basename of %sเป็นแฟ้มที่ทดสอบ2.txt 57string(%d) "เป็นแฟ้มที่ทดสอบ2.txt" 58bool(true) 59string(%d) "%sเป็นแฟ้มที่ทดสอบ2.txt" 60Active code page: %d 61string(6) "hello1" 62Active code page: %d 63getting basename of %sเป็นแฟ้มที่ทดสอบ3.txt 64string(%d) "เป็นแฟ้มที่ทดสอบ3.txt" 65bool(true) 66string(%d) "%sเป็นแฟ้มที่ทดสอบ3.txt" 67Active code page: %d 68string(6) "hello2" 69Active code page: %d 70getting basename of %sเป็นแฟ้มที่ทดสอบ4.txt 71string(%d) "เป็นแฟ้มที่ทดสอบ4.txt" 72bool(true) 73string(%d) "%sเป็นแฟ้มที่ทดสอบ4.txt" 74Active code page: %d 75string(6) "hello3" 76Active code page: %d 77getting basename of %sเป็นแฟ้มที่ทดสอบ5.txt 78string(%d) "เป็นแฟ้มที่ทดสอบ5.txt" 79bool(true) 80string(%d) "%sเป็นแฟ้มที่ทดสอบ5.txt" 81Active code page: %d 82string(6) "hello4" 83Active code page: %d 84getting basename of %sเป็นแฟ้มที่ทดสอบ6.txt 85string(%d) "เป็นแฟ้มที่ทดสอบ6.txt" 86bool(true) 87string(%d) "%sเป็นแฟ้มที่ทดสอบ6.txt" 88Active code page: %d 89string(6) "hello5" 90Active code page: %d 91getting basename of %sเป็นแฟ้มที่ทดสอบ7.txt 92string(%d) "เป็นแฟ้มที่ทดสอบ7.txt" 93bool(true) 94string(%d) "%sเป็นแฟ้มที่ทดสอบ7.txt" 95Active code page: %d 96string(6) "hello6" 97Active code page: %d 98getting basename of %sเป็นแฟ้มที่ทดสอบ8.txt 99string(%d) "เป็นแฟ้มที่ทดสอบ8.txt" 100bool(true) 101string(%d) "%sเป็นแฟ้มที่ทดสอบ8.txt" 102Active code page: %d 103string(6) "hello7" 104Active code page: %d 105getting basename of %sเป็นแฟ้มที่ทดสอบ8 10.txt 106string(%d) "เป็นแฟ้มที่ทดสอบ8 10.txt" 107bool(true) 108string(%d) "%sเป็นแฟ้มที่ทดสอบ8 10.txt" 109Active code page: %d 110string(6) "hello8" 111===DONE=== 112