summaryrefslogtreecommitdiff
path: root/sal
diff options
context:
space:
mode:
authorRüdiger Timm <rt@openoffice.org>2004-05-03 08:17:35 +0000
committerRüdiger Timm <rt@openoffice.org>2004-05-03 08:17:35 +0000
commitb79c38e6bd761bf4243f0d31d297f9e90d7732b0 (patch)
treeed42d0ef81ec3bc9d7681d2bb848624fbfc13137 /sal
parent4d41009c7d07bbbe0e84c60c0f56be2fd1a987ef (diff)
INTEGRATION: CWS qadev17 (1.3.2); FILE MERGED
2004/04/13 13:17:17 lla 1.3.2.1: #116021# UDK_3.1 changed to UDK_3.0 in export.map file
Diffstat (limited to 'sal')
-rw-r--r--sal/qa/rtl/uri/rtl_Uri.cxx20
1 files changed, 15 insertions, 5 deletions
diff --git a/sal/qa/rtl/uri/rtl_Uri.cxx b/sal/qa/rtl/uri/rtl_Uri.cxx
index 8454ff375d66..247e5d23b8d9 100644
--- a/sal/qa/rtl/uri/rtl_Uri.cxx
+++ b/sal/qa/rtl/uri/rtl_Uri.cxx
@@ -115,15 +115,25 @@ namespace Stringtest
void test_FromUTF8_001()
{
- rtl::OString sStr("h%C3%A4llo");
- rtl::OUString suStr = rtl::OStringToOUString(sStr, RTL_TEXTENCODING_ASCII_US);
+ // string --> ustring
+ rtl::OString sStrUTF8("h%C3%A4llo");
+ rtl::OUString suStrUTF8 = rtl::OStringToOUString(sStrUTF8, RTL_TEXTENCODING_ASCII_US);
- rtl::OUString suStr_UriDecodeToIuri = rtl::Uri::decode(suStr, rtl_UriDecodeToIuri, RTL_TEXTENCODING_UTF8);
+ // UTF8 --> real ustring
+ rtl::OUString suStr_UriDecodeToIuri = rtl::Uri::decode(suStrUTF8, rtl_UriDecodeToIuri, RTL_TEXTENCODING_UTF8);
showContent(suStr_UriDecodeToIuri);
+ // string --> ustring
+ rtl::OString sStr("hllo");
+ rtl::OUString suString = rtl::OStringToOUString(sStr, RTL_TEXTENCODING_ISO_8859_15);
+
+ CPPUNIT_ASSERT_MESSAGE("Strings must be equal", suString.equals(suStr_UriDecodeToIuri) == sal_True);
+
+ // ustring --> ustring (UTF8)
rtl::OUString suStr2 = rtl::Uri::encode(suStr_UriDecodeToIuri, rtl_UriCharClassUnoParamValue, rtl_UriEncodeKeepEscapes, RTL_TEXTENCODING_UTF8);
showContent(suStr2);
+ CPPUNIT_ASSERT_MESSAGE("Strings must be equal", suStr2.equals(suStrUTF8) == sal_True);
// suStr should be equal to suStr2
}
@@ -280,8 +290,8 @@ namespace Stringtest
*/
CPPUNIT_TEST_SUITE( Convert );
-// CPPUNIT_TEST( test_FromUTF8_001 );
- CPPUNIT_TEST( test_UTF8_files );
+ CPPUNIT_TEST( test_FromUTF8_001 );
+// CPPUNIT_TEST( test_UTF8_files );
// CPPUNIT_TEST( test_FromUTF8 );
CPPUNIT_TEST_SUITE_END( );
};