How can i decode such html string to a normal html...
# stdlib
v
How can i decode such html string to a normal html string
Copy code
u003Cblockquote class=\"reddit-embed-bq\" style=\"height:316px\" \u003E\n\u003Ca href=\"<https://www.reddit.com/r/androiddev/comments/1cy5g53/why_pwas_have_not_taken_over_and_they_ever_will/>\"\u003EWhy PWAs have not taken over and they ever will?\u003C/a\u003E\u003Cbr\u003E by\n\u003Ca href=\"<https://www.reddit.com/user/pluff-crinoid/>\"\u003Eu/pluff-crinoid\u003C/a\u003E in\n\u003Ca href=\"<https://www.reddit.com/r/androiddev/>\"\u003Eandroiddev\u003C/a\u003E\n\u003C/blockquote\u003E\n\u003Cscript async src=\"<https://embed.reddit.com/widgets.js>\
k
Your string is not quite right: it's missing a backslash at the start and the end is not terminated properly. Assuming you can fix that, you can then decode it as a JSON string. You should be able to use kotlinx.serialization, but for a single use it's easier to use the command-line utility `jq`:
Copy code
jq -r <<<'"\u003Cblockquote class=\"reddit-embed-bq\" style=\"height:316px\" \u003E\n\u003Ca href=\"<https://www.reddit.com/r/androiddev/comments/1cy5g53/why_pwas_have_not_taken_over_and_they_ever_will/>\"\u003EWhy PWAs have not taken over and they ever will?\u003C/a\u003E\u003Cbr\u003E (etc)"'
(The above is a Bash command line. Modify as appropriate to whatever you're using.)
v
Thanks i will try this out