change chat ty byte

This commit is contained in:
stubbfel
2013-10-24 11:08:12 +02:00
parent 6244a9f0cb
commit ef8715aea4
3 changed files with 6 additions and 6 deletions

View File

@@ -15,7 +15,7 @@ namespace ndefpclib.message.Text
/// <param name="content"> The content. </param>
/// <param name="encoding"> The encoding. </param>
/// <param name="lang"> The language. </param>
public TextMessage(string content, char encoding, string lang)
public TextMessage(string content,byte encoding, string lang)
: base(content, new TextType(encoding,lang))
{
}

View File

@@ -11,16 +11,16 @@ namespace ndefpclib.type.Const
public class TextEncoding
{
/// <summary> The UTF 8. </summary>
public const char UTF8 = '\x02';
public const byte UTF8 = 0x02;
/// <summary> The UTF 16. </summary>
public const char UTF16 = '\x82';
public const byte UTF16 = 0x82;
/// <summary> Gets an encoding. </summary>
/// <remarks> Stubbfel, 23.10.2013. </remarks>
/// <param name="input"> The input. </param>
/// <returns> The encoding. </returns>
public static Encoding GetEncoding(char input)
public static Encoding GetEncoding(byte input)
{
switch (input)
{

View File

@@ -16,7 +16,7 @@ namespace ndefpclib.type
/// <remarks> Stubbfel, 23.10.2013. </remarks>
/// <param name="encoding"> (Optional) the encoding. </param>
/// <param name="lang"> (Optional) the language. </param>
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)