diff --git a/plugins/in_tail/tail_config.c b/plugins/in_tail/tail_config.c index e5095b254ad..e1b8205a480 100644 --- a/plugins/in_tail/tail_config.c +++ b/plugins/in_tail/tail_config.c @@ -37,7 +37,7 @@ #endif #ifdef FLB_HAVE_UNICODE_ENCODER -#include +#include #endif static int multiline_load_parsers(struct flb_tail_config *ctx) @@ -112,7 +112,7 @@ struct flb_tail_config *flb_tail_config_create(struct flb_input_instance *ins, ctx->db_sync = 1; /* sqlite sync 'normal' */ #endif #ifdef FLB_HAVE_UNICODE_ENCODER - ctx->preferred_input_encoding = FLB_SIMDUTF_ENCODING_TYPE_UNSPECIFIED; + ctx->preferred_input_encoding = FLB_UNICODE_ENCODING_UNSPECIFIED; #endif /* Load the config map */ @@ -201,17 +201,17 @@ struct flb_tail_config *flb_tail_config_create(struct flb_input_instance *ins, tmp = flb_input_get_property("unicode.encoding", ins); if (tmp) { if (strcasecmp(tmp, "auto") == 0) { - ctx->preferred_input_encoding = FLB_SIMDUTF_ENCODING_TYPE_UNICODE_AUTO; + ctx->preferred_input_encoding = FLB_UNICODE_ENCODING_AUTO; adjust_buffer_for_2bytes_alignments(ctx); } else if (strcasecmp(tmp, "utf-16le") == 0 || strcasecmp(tmp, "utf16-le") == 0) { - ctx->preferred_input_encoding = FLB_SIMDUTF_ENCODING_TYPE_UTF16_LE; + ctx->preferred_input_encoding = FLB_UNICODE_ENCODING_UTF16_LE; adjust_buffer_for_2bytes_alignments(ctx); } else if (strcasecmp(tmp, "utf-16be") == 0 || strcasecmp(tmp, "utf16-be") == 0) { - ctx->preferred_input_encoding = FLB_SIMDUTF_ENCODING_TYPE_UTF16_BE; + ctx->preferred_input_encoding = FLB_UNICODE_ENCODING_UTF16_BE; adjust_buffer_for_2bytes_alignments(ctx); } else { diff --git a/plugins/in_tail/tail_file.c b/plugins/in_tail/tail_file.c index 134731029ba..a265d3d8707 100644 --- a/plugins/in_tail/tail_file.c +++ b/plugins/in_tail/tail_file.c @@ -49,7 +49,7 @@ #endif #ifdef FLB_HAVE_UNICODE_ENCODER -#include +#include #endif #include @@ -460,16 +460,16 @@ static int process_content(struct flb_tail_file *file, size_t *bytes) file->last_processed_bytes = 0; #ifdef FLB_HAVE_UNICODE_ENCODER - if (ctx->preferred_input_encoding != FLB_SIMDUTF_ENCODING_TYPE_UNSPECIFIED) { + if (ctx->preferred_input_encoding != FLB_UNICODE_ENCODING_UNSPECIFIED) { original_len = end - data; decoded = NULL; - ret = flb_simdutf_connector_convert_from_unicode(ctx->preferred_input_encoding, - data, end - data, &decoded, &decoded_len); + ret = flb_unicode_convert(ctx->preferred_input_encoding, + data, end - data, &decoded, &decoded_len); if (ret == FLB_SIMDUTF_CONNECTOR_CONVERT_OK) { data = decoded; end = data + decoded_len; } - else if (ret == FLB_SIMDUTF_CONNECTOR_CONVERT_NOP) { + else if (ret == FLB_UNICODE_CONVERT_NOP) { flb_plg_debug(ctx->ins, "nothing to convert encoding '%.*s'", end - data, data); } else { diff --git a/tests/runtime/in_tail.c b/tests/runtime/in_tail.c index e569dbc612f..5476dee1ae4 100644 --- a/tests/runtime/in_tail.c +++ b/tests/runtime/in_tail.c @@ -27,7 +27,7 @@ Approach for this tests is basing on filter_kubernetes tests #include #include #ifdef FLB_HAVE_UNICODE_ENCODER -#include +#include #endif #include #include @@ -455,7 +455,7 @@ static int cb_check_result_unicode(void *record, size_t size, void *data) goto exit; } - valid = flb_simdutf_connector_validate_utf8(record, size); + valid = flb_unicode_validate(record, size); if (valid == FLB_FALSE) { goto exit; }