You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@avro.apache.org by "KalleOlaviNiemitalo (via GitHub)" <gi...@apache.org> on 2025/07/06 11:22:17 UTC

Re: [PR] AVRO-4136: [c] json encoding of byte[] containing 0x00 [avro]

KalleOlaviNiemitalo commented on code in PR #3375:
URL: https://github.com/apache/avro/pull/3375#discussion_r2188162577


##########
lang/c/src/value-json.c:
##########
@@ -29,7 +29,7 @@
 #include "jansson.h"
 
 /*
- * Converts a binary buffer into a NUL-terminated JSON UTF-8 string.
+ * Converts a binary buffer into a JSON UTF-8 string which is not NULL terminated!

Review Comment:
   This comment is a bit misleading.   `encode_utf8_bytes` does not encode control characters as `\u0001` etc. like JSON requires, so the result isn't really a "JSON UTF-8 string".
   
   I'd prefer "null-terminated" to "NULL-terminated" because the `NULL` macro in \<stddef.h\> is intended as a pointer rather than a character.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@avro.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org