From 3cb9c15995b828c52dba34d0a222f572d5bbc41b Mon Sep 17 00:00:00 2001 From: Bernard Normier Date: Thu, 20 Oct 2016 21:03:44 -0400 Subject: Added support for non-ASCII characters and universal character names to stringified identities and proxies. This includes a new Ice.ToStringMode property. --- cpp/test/Ice/stringConverter/Client.cpp | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'cpp/test/Ice/stringConverter/Client.cpp') diff --git a/cpp/test/Ice/stringConverter/Client.cpp b/cpp/test/Ice/stringConverter/Client.cpp index 4a8e7027aea..f0d7f4df1cd 100644 --- a/cpp/test/Ice/stringConverter/Client.cpp +++ b/cpp/test/Ice/stringConverter/Client.cpp @@ -127,6 +127,22 @@ main(int argc, char* argv[]) wstring wmsg = proxy->widen(msg); test(proxy->narrow(wmsg) == msg); test(wmsg.size() == msg.size()); + + // Test stringToIdentity and identityToString + + string identStr = "cat/" + msg; + Ice::Identity ident = Ice::stringToIdentity(identStr); + test(ident.name == msg); + test(ident.category == "cat"); + test(identityToString(ident, Ice::ICE_ENUM(ToStringMode, Unicode)) == identStr); + + identStr = identityToString(ident, Ice::ICE_ENUM(ToStringMode, ASCII)); + test(identStr == "cat/tu me fends le c\\u0153ur!"); + test(Ice::stringToIdentity(identStr) == ident); + identStr = identityToString(ident, Ice::ICE_ENUM(ToStringMode, Compat)); + test(identStr == "cat/tu me fends le c\\305\\223ur!"); + test(Ice::stringToIdentity(identStr) == ident); + communicator->destroy(); cout << "ok" << endl; } @@ -134,7 +150,6 @@ main(int argc, char* argv[]) Ice::setProcessStringConverter(ICE_NULLPTR); Ice::setProcessWstringConverter(Ice::createUnicodeWstringConverter()); - string propValue = "Ice:createStringConverter"; if(useIconv && !useLocale) { -- cgit v1.2.3