diff --git a/tests/test_ndef_construction.c b/tests/test_ndef_construction.c index ac9b8db1..bc40943f 100644 --- a/tests/test_ndef_construction.c +++ b/tests/test_ndef_construction.c @@ -104,17 +104,17 @@ static void _test_other_lang_text(void) YK_NDEF *ndef = ykp_alloc_ndef(); char text[] = "aaaaaaaaaaaaaaa"; size_t text_len = strlen(text); - int rc = ykp_construct_ndef_text(ndef, text, "sv-SE", true); - char text2[256]; + int rc = ykp_construct_ndef_text(ndef, text, "sv-SE", false); + char text2[256] = {0}; assert(rc == 1); assert(ndef->type == 'T'); - assert(ndef->data[0] == (0x80 & 5)); + assert(ndef->data[0] == (5)); assert(memcmp(ndef->data + 1, "sv-SE", 5) == 0); assert(memcmp(ndef->data + 6, text, text_len) == 0); assert(ndef->len == text_len + 6); rc = ykp_ndef_as_text(ndef, text2, 256); assert(rc == 1); - assert(memcmp(text, text2, strlen(text))); + assert(memcmp(text, text2, strlen(text)) == 0); ykp_free_ndef(ndef); } diff --git a/ykpers.c b/ykpers.c index 2413b351..973cd9d4 100644 --- a/ykpers.c +++ b/ykpers.c @@ -473,7 +473,8 @@ int ykp_construct_ndef_text(YK_NDEF *ndef, const char *text, const char *lang, b size_t lang_length = strlen(lang); unsigned char status = lang_length; if(isutf16) { - status &= 0x80; + ykp_errno = YKP_ENOTYETIMPL; + return 0; } if((data_length + lang_length + 1) > NDEF_DATA_SIZE) { ykp_errno = YKP_EINVAL;