https://kotlinlang.org logo
#serialization
Title
# serialization
d

dave08

03/09/2023, 1:35 PM
What could this mean:
kotlinx.serialization.json.internal.JsonDecodingException: Unexpected JSON token at offset 46098: Expected quotation mark '"', but had '"' instead at path:
"
and
"
is the same, no?
c

CLOVIS

03/09/2023, 1:40 PM
If you have Bash, you can execute
Copy code
<<<'your text here' hexdump
to print the exact character codes
d

dave08

03/09/2023, 1:42 PM
😮 » <<<'""' hexdump 0000000 2222 000a 0000003
Moshi is sending that from the client side --- and it's not happening for all our requests...
c

CLOVIS

03/09/2023, 1:43 PM
Well at least now you have a tool to check… good luck finding who's emitting it 😅
d

dave08

03/09/2023, 1:44 PM
Thanks!
c

CLOVIS

03/09/2023, 1:44 PM
🤔 wait, 0x22 is the regular code for quotes
d

dave08

03/09/2023, 1:48 PM
000a is a line feed... but it looks like a double quote...
and 2222: ∢
c

CLOVIS

03/09/2023, 1:50 PM
I believe it prints the hex codes, so it's saying the input is Ox22 Ox22, not dec 2222
you can use
Copy code
<<<'your text' hexdump -C
for a more precise output
d

dave08

03/09/2023, 1:51 PM
<<<'""' hexdump -c 0000000 " " \n 0000003
c

CLOVIS

03/09/2023, 1:52 PM
it's an uppercase C, lowercase c is something else
d

dave08

03/09/2023, 1:52 PM
<<<'""' hexdump -C 00000000 22 22 0a |"".| 00000003
c

CLOVIS

03/09/2023, 1:53 PM
🤔 so they are indeed the same
d

dave08

03/09/2023, 1:53 PM
Maybe the line feed is the problem?
But the error is very unclear...
68 Views