47 1, 1, 1, 1, 1, 1, 1, 1,
49 0, 0, 0, 0, 2, 2, 3, -1 },
52 4, 4, 4, 4, 4, 4, 4, 4,
53 5, 5, 5, 5, 6, 6, -1, -1 }
65 #define U8E_ILLSTART -2 66 #define U8E_NOTCONT -3 77 "%s: value not given", td->
name);
81 "%s: truncated UTF-8 sequence (%s:%d)",
82 td->
name, __FILE__, __LINE__);
86 "%s: UTF-8 illegal start of encoding (%s:%d)",
87 td->
name, __FILE__, __LINE__);
91 "%s: UTF-8 not continuation (%s:%d)",
92 td->
name, __FILE__, __LINE__);
96 "%s: UTF-8 not minimal sequence (%s:%d)",
97 td->
name, __FILE__, __LINE__);
100 return (len < 0) ? -1 : 0;
106 uint8_t *buf = st->
buf;
107 uint8_t *end = buf + st->
size;
108 uint32_t *dstend = dst + dstlen;
110 for(length = 0; buf < end; length++) {
122 if(want != -1)
break;
133 value = ch & (0xff >> want);
135 for(buf++; buf < cend; buf++) {
138 value = (value << 6) | (ch & 0x3F);
146 if(dst < dstend) *dst = 0;
165 return (ret < 0) ? 0 : ret;
180 return (cb(st->
buf, st->
size, app_key) < 0) ? -1 : 0;
182 return (cb(
"<absent>", 8, app_key) < 0) ? -1 : 0;
asn_TYPE_descriptor_t asn_DEF_UTF8String
static int32_t UTF8String_mv[7]
per_type_decoder_f OCTET_STRING_decode_uper
per_type_encoder_f OCTET_STRING_encode_uper
xer_type_decoder_f OCTET_STRING_decode_xer_utf8
static int UTF8String_ht[2][16]
size_t UTF8String_to_wcs(const UTF8String_t *st, uint32_t *dst, size_t dstlen)
asn_struct_free_f OCTET_STRING_free
static ber_tlv_tag_t asn_DEF_UTF8String_tags[]
ssize_t UTF8String_length(const UTF8String_t *st)
int UTF8String_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_constraint_failed_f *ctfailcb, void *app_key)
int UTF8String_print(asn_TYPE_descriptor_t *td, const void *sptr, int ilevel, asn_app_consume_bytes_f *cb, void *app_key)
int() asn_app_consume_bytes_f(const void *buffer, size_t size, void *application_specific_key)
void() asn_app_constraint_failed_f(void *application_specific_key, struct asn_TYPE_descriptor_s *type_descriptor_which_failed, const void *structure_which_failed_ptr, const char *error_message_format,...) GCC_PRINTFLIKE(4
ber_type_decoder_f OCTET_STRING_decode_ber
xer_type_encoder_f OCTET_STRING_encode_xer_utf8
der_type_encoder_f OCTET_STRING_encode_der
static ssize_t UTF8String__process(const UTF8String_t *st, uint32_t *dst, size_t dstlen)