1--TEST--
2Test convert_cyr_string() function : basic functionality
3--FILE--
4<?php
5
6/* Prototype  : string convert_cyr_string  ( string $str  , string $from  , string $to  )
7 * Description: Convert from one Cyrillic character set to another
8 * Source code: ext/standard/string.c
9*/
10
11echo "*** Testing convert_cyr_string() : basic functionality ***\n";
12
13$str = "Convert from one Cyrillic character set to another.";
14
15echo "\n-- First try some simple English text --\n";
16var_dump(bin2hex(convert_cyr_string($str, 'w', 'k')));
17var_dump(bin2hex(convert_cyr_string($str, 'w', 'i')));
18
19
20echo "\n-- Now try some of characters in 128-255 range --\n";
21
22for ($i = 128; $i < 256; $i++) {
23	$str = chr($i);
24	echo "$i: " . bin2hex(@convert_cyr_string($str, 'w', 'k')) . "\n";
25}
26
27?>
28===DONE===
29--EXPECTF--
30*** Testing convert_cyr_string() : basic functionality ***
31
32-- First try some simple English text --
33
34Deprecated: Function convert_cyr_string() is deprecated in %s on line %d
35string(102) "436f6e766572742066726f6d206f6e6520437972696c6c6963206368617261637465722073657420746f20616e6f746865722e"
36
37Deprecated: Function convert_cyr_string() is deprecated in %s on line %d
38string(102) "436f6e766572742066726f6d206f6e6520437972696c6c6963206368617261637465722073657420746f20616e6f746865722e"
39
40-- Now try some of characters in 128-255 range --
41128: 2e
42129: 2e
43130: 2e
44131: 2e
45132: 2e
46133: 2e
47134: 2e
48135: 2e
49136: 2e
50137: 2e
51138: 2e
52139: 2e
53140: 2e
54141: 2e
55142: 2e
56143: 2e
57144: 2e
58145: 2e
59146: 2e
60147: 2e
61148: 2e
62149: 2e
63150: 2e
64151: 2e
65152: 2e
66153: 2e
67154: 2e
68155: 2e
69156: 2e
70157: 2e
71158: 2e
72159: 2e
73160: 9a
74161: ae
75162: be
76163: 2e
77164: 9f
78165: bd
79166: 2e
80167: 2e
81168: b3
82169: bf
83170: b4
84171: 9d
85172: 2e
86173: 2e
87174: 9c
88175: b7
89176: 2e
90177: 2e
91178: b6
92179: a6
93180: ad
94181: 2e
95182: 2e
96183: 9e
97184: a3
98185: 98
99186: a4
100187: 9b
101188: 2e
102189: 2e
103190: 2e
104191: a7
105192: e1
106193: e2
107194: f7
108195: e7
109196: e4
110197: e5
111198: f6
112199: fa
113200: e9
114201: ea
115202: eb
116203: ec
117204: ed
118205: ee
119206: ef
120207: f0
121208: f2
122209: f3
123210: f4
124211: f5
125212: e6
126213: e8
127214: e3
128215: fe
129216: fb
130217: fd
131218: ff
132219: f9
133220: f8
134221: fc
135222: e0
136223: f1
137224: c1
138225: c2
139226: d7
140227: c7
141228: c4
142229: c5
143230: d6
144231: da
145232: c9
146233: ca
147234: cb
148235: cc
149236: cd
150237: ce
151238: cf
152239: d0
153240: d2
154241: d3
155242: d4
156243: d5
157244: c6
158245: c8
159246: c3
160247: de
161248: db
162249: dd
163250: df
164251: d9
165252: d8
166253: dc
167254: c0
168255: d1
169===DONE===
170