[smuxi] Engine(-Tests): support IDN TLDs
- From: Mirco M. M. Bauer <mmmbauer src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [smuxi] Engine(-Tests): support IDN TLDs
- Date: Tue, 1 Sep 2015 17:00:52 +0000 (UTC)
commit 515ab1291354f2146f3b230c19f2bb94c196332c
Author: Mirco Bauer <meebey meebey net>
Date: Tue Sep 1 18:57:57 2015 +0200
Engine(-Tests): support IDN TLDs
The 2nd level domain name and also top-level domain names can contain puny-code
and thus unicode letters.
src/Engine-Tests/MessageBuilderTests.cs | 6 ++++++
src/Engine/Config/MessageBuilderSettings.cs | 2 +-
2 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/src/Engine-Tests/MessageBuilderTests.cs b/src/Engine-Tests/MessageBuilderTests.cs
index 74ba179..b63e568 100644
--- a/src/Engine-Tests/MessageBuilderTests.cs
+++ b/src/Engine-Tests/MessageBuilderTests.cs
@@ -615,6 +615,12 @@ namespace Smuxi.Engine
builder.TimeStamp = DateTime.MinValue;
builder.Append(new UrlMessagePartModel(msg));
TestMessage(msg, builder.ToMessage());
+
+ msg = "http://مثال.ايران/";
+ builder = new MessageBuilder();
+ builder.TimeStamp = DateTime.MinValue;
+ builder.Append(new UrlMessagePartModel(msg));
+ TestMessage(msg, builder.ToMessage());
}
[Test]
diff --git a/src/Engine/Config/MessageBuilderSettings.cs b/src/Engine/Config/MessageBuilderSettings.cs
index f49c33a..cf7b7e1 100644
--- a/src/Engine/Config/MessageBuilderSettings.cs
+++ b/src/Engine/Config/MessageBuilderSettings.cs
@@ -75,7 +75,7 @@ namespace Smuxi.Engine
string domain_chars = @"[a-z0-9\-\p{L}]+";
string subdomain = domain_chars + @"\.";
string common_tld = @"de|es|im|us|com|net|org|info|biz|gov|name|edu|onion|museum";
- string any_tld = @"[a-z]+";
+ string any_tld = @"[a-z\p{L}]+";
string ip6 = @"(?:[0-9a-f]{0,4}:){1,7}[0-9a-f]{1,4}";
string quoted_ip6 = @"\[" + ip6 + @"\]";
string ip4 = @"(?:[0-9]{1,3}\.){3}[0-9]{1,3}";
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]