From ef8715aea434969cd72436e2508c6db207b3c63d Mon Sep 17 00:00:00 2001 From: stubbfel Date: Thu, 24 Oct 2013 11:08:12 +0200 Subject: [PATCH] change chat ty byte --- src/ndefpclib/message/Text/TextMessages.cs | 2 +- src/ndefpclib/type/Const/TextEncoding.cs | 6 +++--- src/ndefpclib/type/TextType.cs | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/ndefpclib/message/Text/TextMessages.cs b/src/ndefpclib/message/Text/TextMessages.cs index b457bf0..f664ade 100644 --- a/src/ndefpclib/message/Text/TextMessages.cs +++ b/src/ndefpclib/message/Text/TextMessages.cs @@ -15,7 +15,7 @@ namespace ndefpclib.message.Text /// The content. /// The encoding. /// The language. - public TextMessage(string content, char encoding, string lang) + public TextMessage(string content,byte encoding, string lang) : base(content, new TextType(encoding,lang)) { } diff --git a/src/ndefpclib/type/Const/TextEncoding.cs b/src/ndefpclib/type/Const/TextEncoding.cs index 8c6fff6..6022c54 100644 --- a/src/ndefpclib/type/Const/TextEncoding.cs +++ b/src/ndefpclib/type/Const/TextEncoding.cs @@ -11,16 +11,16 @@ namespace ndefpclib.type.Const public class TextEncoding { /// The UTF 8. - public const char UTF8 = '\x02'; + public const byte UTF8 = 0x02; /// The UTF 16. - public const char UTF16 = '\x82'; + public const byte UTF16 = 0x82; /// Gets an encoding. /// Stubbfel, 23.10.2013. /// The input. /// The encoding. - public static Encoding GetEncoding(char input) + public static Encoding GetEncoding(byte input) { switch (input) { diff --git a/src/ndefpclib/type/TextType.cs b/src/ndefpclib/type/TextType.cs index 705e3d0..2f30c6d 100644 --- a/src/ndefpclib/type/TextType.cs +++ b/src/ndefpclib/type/TextType.cs @@ -16,7 +16,7 @@ namespace ndefpclib.type /// Stubbfel, 23.10.2013. /// (Optional) the encoding. /// (Optional) the language. - public TextType(char encoding = TextEncoding.UTF8, string lang = Language.DE) + public TextType(byte encoding = TextEncoding.UTF8, string lang = Language.DE) { this.TNFValue = TNFVAL.WKT; this.TypeValue = TYPEVAL.TEXT; @@ -40,7 +40,7 @@ namespace ndefpclib.type return null; } - char encoding = (char)array[index + 4]; + byte encoding = array[index + 4]; Encoding encoder = TextEncoding.GetEncoding(encoding); if (encoder == null)