Transaction Output doesn't display utf-8 chars correctly
uqix opened this issue · 9 comments
As you can see, key in Output displays correctly, but value does not(e.g. province
field)
Hey, guys, we really need this sorted out.
@dshuffma-ibm Is this possible? Ui displays the value
from the write-set as-is
@uqix I hope I don't bore you with a lot of details but here it goes. This field in particular is practically impossible for us to get right 100% of the time. Fabric does not give us a way of knowing what encoding to use for value
in a KVWrite
message type. To fabric is all bytes
aka binary data, and thus is just some opaque jumble of bits. Check out the message formats here:
however you can make an educated guesses that most projects write text of some kind b/c thats what most of the fabric-examples do. anyway that is what the console does, we assumed ASCII data and try to decode that. since ASCII is a subset of utf8 we don't support all unicode characters, as you have found out.
so we could improve that. aka this is a valid issue. its actually not that hard, but I don't know when I can pick it up.
@uqix could you provide the correct value
text? that will help testing.
oh also, notice how the key
field is typed as a "string"
(and golang represents strings with utf8, I think*) so, that's why there is no confusion on representing keys.
edit: lol ah, so golang doesn't actually represent string
types with utf8! but whatever, being typed as string
vs bytes
is still the difference on one working and the other not.
alrighty, I decided to do this real quick after all.
once #210 is merged you should be good.
I will test it once merged.
Output fixed,
Input still has the problem.
thanks for testing it @uqix
Tested and all fixed. Thanks.