summaryrefslogtreecommitdiffstats
path: root/testfiles/src/uri-test.cpp
diff options
context:
space:
mode:
authorThomas Holder <thomas@thomas-holder.de>2018-12-24 10:31:48 +0000
committerThomas Holder <thomas@thomas-holder.de>2018-12-24 10:46:21 +0000
commit88f9ed7759bd4bbe08da6f3eba5961060bd364cc (patch)
tree9443d7d98070a5fabb7986b25e8df465cb952894 /testfiles/src/uri-test.cpp
parentfix get_filename with locale!=NULL (diff)
downloadinkscape-88f9ed7759bd4bbe08da6f3eba5961060bd364cc.tar.gz
inkscape-88f9ed7759bd4bbe08da6f3eba5961060bd364cc.zip
rebase_hrefs: store IRI (UTF-8), not URI (ASCII)
Diffstat (limited to 'testfiles/src/uri-test.cpp')
-rw-r--r--testfiles/src/uri-test.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/testfiles/src/uri-test.cpp b/testfiles/src/uri-test.cpp
index ade6f3245..91af2e7af 100644
--- a/testfiles/src/uri-test.cpp
+++ b/testfiles/src/uri-test.cpp
@@ -282,6 +282,16 @@ TEST(UriTest, from_native_filename)
#endif
}
+TEST(UriTest, uri_to_iri)
+{
+ // unescape UTF-8 (U+00D6)
+ ASSERT_EQ(Inkscape::uri_to_iri("data:,umlaut-%C3%96"), "data:,umlaut-\xC3\x96");
+ // don't unescape ASCII (U+003A)
+ ASSERT_EQ(Inkscape::uri_to_iri("foo%3Abar"), "foo%3Abar");
+ // sequence (U+00D6 U+1F37A U+003A)
+ ASSERT_EQ(Inkscape::uri_to_iri("%C3%96%F0%9F%8D%BA%3A"), "\xC3\x96\xF0\x9F\x8D\xBA%3A");
+}
+
/*
Local Variables:
mode:c++