summaryrefslogtreecommitdiff
path: root/php
diff options
context:
space:
mode:
authorJose <jose@zeroc.com>2016-03-08 13:46:55 +0100
committerJose <jose@zeroc.com>2016-03-08 13:46:55 +0100
commit2bd402833bfdb54c1940dd0038be8af05d6f5e6f (patch)
treeeb7be3853dc45452397b730e586434f6e859efb3 /php
parentWindows fixes for icegriddb/icestormdb (diff)
downloadice-2bd402833bfdb54c1940dd0038be8af05d6f5e6f.tar.bz2
ice-2bd402833bfdb54c1940dd0038be8af05d6f5e6f.tar.xz
ice-2bd402833bfdb54c1940dd0038be8af05d6f5e6f.zip
ICE-6991 - Add support for unicode escape sequences
Diffstat (limited to 'php')
-rw-r--r--php/test/Ice/operations/Client.php117
-rw-r--r--php/test/Ice/operations/Test.ice68
2 files changed, 184 insertions, 1 deletions
diff --git a/php/test/Ice/operations/Client.php b/php/test/Ice/operations/Client.php
index 40583fb9e05..da449507589 100644
--- a/php/test/Ice/operations/Client.php
+++ b/php/test/Ice/operations/Client.php
@@ -41,6 +41,123 @@ function twoways($communicator, $p)
$myDerivedClass = $NS ? "Test\\MyDerivedClass" : "Test_MyDerivedClass";
$myClass = $NS ? "Test\\MyClass" : "Test_MyClass";
$objectPrxHelper = $NS ? "Ice\\ObjectPrxHelper" : "Ice_ObjectPrxHelper";
+
+
+ $s0 = $NS ? constant("Test\\s0") : constant("Test_s0");
+ $s1 = $NS ? constant("Test\\s1") : constant("Test_s1");
+ $s2 = $NS ? constant("Test\\s2") : constant("Test_s2");
+ $s3 = $NS ? constant("Test\\s3") : constant("Test_s3");
+ $s4 = $NS ? constant("Test\\s4") : constant("Test_s4");
+ $s5 = $NS ? constant("Test\\s5") : constant("Test_s5");
+ $s6 = $NS ? constant("Test\\s6") : constant("Test_s6");
+ $s7 = $NS ? constant("Test\\s7") : constant("Test_s7");
+ $s8 = $NS ? constant("Test\\s8") : constant("Test_s8");
+ $s9 = $NS ? constant("Test\\s9") : constant("Test_s9");
+ $s10 = $NS ? constant("Test\\s10") : constant("Test_s10");
+
+ $sw0 = $NS ? constant("Test\\sw0") : constant("Test_sw0");
+ $sw1 = $NS ? constant("Test\\sw1") : constant("Test_sw1");
+ $sw2 = $NS ? constant("Test\\sw2") : constant("Test_sw2");
+ $sw3 = $NS ? constant("Test\\sw3") : constant("Test_sw3");
+ $sw4 = $NS ? constant("Test\\sw4") : constant("Test_sw4");
+ $sw5 = $NS ? constant("Test\\sw5") : constant("Test_sw5");
+ $sw6 = $NS ? constant("Test\\sw6") : constant("Test_sw6");
+ $sw7 = $NS ? constant("Test\\sw7") : constant("Test_sw7");
+ $sw8 = $NS ? constant("Test\\sw8") : constant("Test_sw8");
+ $sw9 = $NS ? constant("Test\\sw9") : constant("Test_sw9");
+ $sw10 = $NS ? constant("Test\\sw10") : constant("Test_sw10");
+
+ $ss0 = $NS ? constant("Test\\ss0") : constant("Test_ss0");
+ $ss1 = $NS ? constant("Test\\ss1") : constant("Test_ss1");
+ $ss2 = $NS ? constant("Test\\ss2") : constant("Test_ss2");
+ $ss3 = $NS ? constant("Test\\ss3") : constant("Test_ss3");
+ $ss4 = $NS ? constant("Test\\ss4") : constant("Test_ss4");
+ $ss5 = $NS ? constant("Test\\ss5") : constant("Test_ss5");
+
+ $su0 = $NS ? constant("Test\\su0") : constant("Test_su0");
+ $su1 = $NS ? constant("Test\\su1") : constant("Test_su1");
+ $su2 = $NS ? constant("Test\\su2") : constant("Test_su2");
+
+ {
+ $literals = $p->opStringLiterals();
+
+ test($s0 == "\\" &&
+ $s0 == $sw0 &&
+ $s0 == $literals[0] &&
+ $s0 == $literals[11]);
+
+ test($s1 == "A" &&
+ $s1 == $sw1 &&
+ $s1 == $literals[1] &&
+ $s1 == $literals[12]);
+
+ test($s2 == "Ice" &&
+ $s2 == $sw2 &&
+ $s2 == $literals[2] &&
+ $s2 == $literals[13]);
+
+ test($s3 == "A21" &&
+ $s3 == $sw3 &&
+ $s3 == $literals[3] &&
+ $s3 == $literals[14]);
+
+ test($s4 == "\\u0041 \\U00000041" &&
+ $s4 == $sw4 &&
+ $s4 == $literals[4] &&
+ $s4 == $literals[15]);
+
+ test($s5 == "\xc3\xbf" &&
+ $s5 == $sw5 &&
+ $s5 == $literals[5] &&
+ $s5 == $literals[16]);
+
+ test($s6 == "\xcf\xbf" &&
+ $s6 == $sw6 &&
+ $s6 == $literals[6] &&
+ $s6 == $literals[17]);
+
+ test($s7 == "\xd7\xb0" &&
+ $s7 == $sw7 &&
+ $s7 == $literals[7] &&
+ $s7 == $literals[18]);
+
+ test($s8 == "\xf0\x90\x80\x80" &&
+ $s8 == $sw8 &&
+ $s8 == $literals[8] &&
+ $s8 == $literals[19]);
+
+ test($s9 == "\xf0\x9f\x8d\x8c" &&
+ $s9 == $sw9 &&
+ $s9 == $literals[9] &&
+ $s9 == $literals[20]);
+
+ test($s10 == "\xe0\xb6\xa7" &&
+ $s10 == $sw10 &&
+ $s10 == $literals[10] &&
+ $s10 == $literals[21]);
+
+ test($ss0 == "'\"?\\\007\010\f\n\r\t\v" &&
+ $ss0 == $ss1 &&
+ $ss1 == $ss2 &&
+ $ss0 == $literals[22] &&
+ $ss0 == $literals[23] &&
+ $ss0 == $literals[24]);
+
+ test($ss3 == "\\\\U\\u\\" &&
+ $ss3 == $literals[25]);
+
+ test($ss4 == "\\A\\" &&
+ $ss4 == $literals[26]);
+
+ test($ss5 == "\\u0041\\" &&
+ $ss5 == $literals[27]);
+
+ test($su0 == $su1 &&
+ $su0 == $su2 &&
+ $su0 == $literals[28] &&
+ $su0 == $literals[29] &&
+ $su0 == $literals[30]);
+ }
{
$p->ice_ping();
diff --git a/php/test/Ice/operations/Test.ice b/php/test/Ice/operations/Test.ice
index 4d314fc8e0b..7c37371e0b9 100644
--- a/php/test/Ice/operations/Test.ice
+++ b/php/test/Ice/operations/Test.ice
@@ -224,6 +224,8 @@ class MyClass
ByteBoolD opByteBoolD1(ByteBoolD opByteBoolD1);
StringS opStringS2(StringS stringS);
ByteBoolD opByteBoolD2(ByteBoolD byteBoolD);
+
+ StringS opStringLiterals();
};
// Test data member with same name as class
@@ -249,5 +251,69 @@ class MyDerivedClass extends MyClass
MyClass1 opMyClass1(MyClass1 c);
};
-};
+//
+// String literals
+//
+const string s0 = "\u005c"; // backslash
+const string s1 = "\u0041"; // A
+const string s2 = "\u0049\u0063\u0065"; // Ice
+const string s3 = "\u004121"; // A21
+const string s4 = "\\u0041 \\U00000041"; // \\u0041 \\U00000041
+const string s5 = "\u00FF"; // ÿ
+const string s6 = "\u03FF"; // GREEK CAPITAL REVERSED DOTTED LUNATE SIGMA SYMBOL (U+03FF)
+const string s7 = "\u05F0"; // HEBREW LIGATURE YIDDISH DOUBLE VAV (U+05F0)
+const string s8 = "\U00010000"; // LINEAR B SYLLABLE B008 A (U+10000)
+const string s9 = "\U0001F34C"; // BANANA (U+1F34C)
+const string s10 = "\u0DA7"; // Sinhala Letter Alpapraana Ttayanna
+
+const string sw0 = "\U0000005c"; // backslash
+const string sw1 = "\U00000041"; // A
+const string sw2 = "\U00000049\U00000063\U00000065"; // Ice
+const string sw3 = "\U0000004121"; // A21
+const string sw4 = "\\u0041 \\U00000041"; // \\u0041 \\U00000041
+const string sw5 = "\U000000FF"; // ÿ
+const string sw6 = "\U000003FF"; // GREEK CAPITAL REVERSED DOTTED LUNATE SIGMA SYMBOL (U+03FF)
+const string sw7 = "\U000005F0"; // HEBREW LIGATURE YIDDISH DOUBLE VAV (U+05F0)
+const string sw8 = "\U00010000"; // LINEAR B SYLLABLE B008 A (U+10000)
+const string sw9 = "\U0001F34C"; // BANANA (U+1F34C)
+const string sw10 = "\U00000DA7"; // Sinhala Letter Alpapraana Ttayanna
+
+/**
+\' single quote byte 0x27 in ASCII encoding
+\" double quote byte 0x22 in ASCII encoding
+\? question mark byte 0x3f in ASCII encoding
+\\ backslash byte 0x5c in ASCII encoding
+\a audible bell byte 0x07 in ASCII encoding
+\b backspace byte 0x08 in ASCII encoding
+\f form feed - new page byte 0x0c in ASCII encoding
+\n line feed - new line byte 0x0a in ASCII encoding
+\r carriage return byte 0x0d in ASCII encoding
+\t horizontal tab byte 0x09 in ASCII encoding
+\v vertical tab byte 0x0b in ASCII encoding
+**/
+
+const string ss0 = "\'\"\?\\\a\b\f\n\r\t\v";
+const string ss1 = "\u0027\u0022\u003f\u005c\u0007\u0008\u000c\u000a\u000d\u0009\u000b";
+const string ss2 = "\U00000027\U00000022\U0000003f\U0000005c\U00000007\U00000008\U0000000c\U0000000a\U0000000d\U00000009\U0000000b";
+
+const string ss3 = "\\\\U\\u\\"; /* \\U\u\ */
+const string ss4 = "\\\u0041\\"; /* \A\ */
+const string ss5 = "\\u0041\\"; /* \u0041\ */
+
+//
+// ÿ - Unicode Character 'LATIN SMALL LETTER Y WITH DIAERESIS' (U+00FF)
+// Ā - Unicode Character 'LATIN CAPITAL LETTER A WITH MACRON' (U+0100)
+// ἀ - Unicode Character 'GREEK SMALL LETTER ALPHA WITH PSILI' (U+1F00)
+// 𐆔 - Unicode Character 'ROMAN DIMIDIA SEXTULA SIGN' (U+10194)
+// 𐅪 - Unicode Character 'GREEK ACROPHONIC THESPIAN ONE HUNDRED' (U+1016A)
+// 𐆘 - Unicode Character 'ROMAN SESTERTIUS SIGN' (U+10198)
+// 🍀 - Unicode Character 'FOUR LEAF CLOVER' (U+1F340)
+// 🍁 - Unicode Character 'MAPLE LEAF' (U+1F341)
+// 🍂 - Unicode Character 'FALLEN LEAF' (U+1F342)
+// 🍃 - Unicode Character 'LEAF FLUTTERING IN WIND' (U+1F343)
+const string su0 = "ÿĀἀ𐆔𐅪𐆘🍀🍁🍂🍃";
+const string su1 = "\u00FF\u0100\u1F00\U00010194\U0001016A\U00010198\U0001F340\U0001F341\U0001F342\U0001F343";
+const string su2 = "\U000000FF\U00000100\U00001F00\U00010194\U0001016A\U00010198\U0001F340\U0001F341\U0001F342\U0001F343";
+
+};