[ 
https://issues.apache.org/jira/browse/AVRO-1875?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15362891#comment-15362891
 ] 

Ryan Blue commented on AVRO-1875:
---------------------------------

[~nocs00], what do you mean that "byte arrays in JSON are encoded in Latin-1 
encoding"? There's a [spec for encoding 
JSON|https://avro.apache.org/docs/1.8.1/spec.html#schema_record] byte arrays, 
which is "Unicode code points 0-255 are mapped to unsigned 8-bit byte values 
0-255". Then the entire JSON blob should be encoded [using 
UTF-8|https://github.com/apache/avro/blob/master/lang/java/avro/src/main/java/org/apache/avro/io/JsonEncoder.java#L84].

I think the JsonEncoder already writes data to spec and changing how byte 
arrays are serialized would break readers. There's been talk of a new JSON spec 
that behaves more like one would expect. Maybe that's a more appropriate place 
to change the byte array encoding to use base 64?

> ability encode/decode byte arrays in Base64
> -------------------------------------------
>
>                 Key: AVRO-1875
>                 URL: https://issues.apache.org/jira/browse/AVRO-1875
>             Project: Avro
>          Issue Type: Improvement
>          Components: java
>            Reporter: Paul Dudenkov
>             Fix For: 1.9.0
>
>
> Hi, 
> I would like to add ability encode/decode byte arrays in Base64 in classes 
> JsonEncoder JsonDecoder.
> For this purpose I will add new constructors and overloaded factory methods.
> Old code will work as before.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to