java - Convert string with utf-8 to unicode -


i have string contains utf-8 encoded emojis. string escaped. need convert utf-8 emojis , print them properly. example:

input: \\xe2\\x80\\x9c@vinefights: not care lamo!!!  \\xf0\\x9f\\x98\\x82 https:\\/\\/t.co\\/twmyfehx9g\\xe2\\x80\\x9d\\xf0\\x9f\\x98\\x82\\xf0 \\x9f\\x98\\xad\\xf0\\x9f\\x98\\xad   expected output: not care lamo!!! 😂 url”😂😭😭 

this 1 sinle string (without breaks). have broken down fit in 1 view in question.
idea extract emojis using regex (\\\\x[a-fa-f0-9]{2})+ , replace them converting bytes manually emojis. failed in several cases 1 in example. feels unnecessary hacky/ugly solution. what's right way handle it?

(more interested know how done in real world. examples appreciated)


Comments

Popular posts from this blog

jsf - "PropertyNotWritableException: Illegal Syntax for Set Operation" error when setting value in bean -

arrays - Algorithm to find ideal starting spot in a circle -

php - Autoloader issue not returning Class -