Java: how to convert unicode string Emoji to Integer -


i received unicode string contain emoji code, example: "u+1f44f" (from emoji table : http://apps.timwhitlock.info/emoji/tables/unicode).

i want convert string integer how can ?

i tried this, crashs:

int hex = integer.parseint(unicodestr, 16); 

thanks guys!

the comment of flkes gives correct answere. u+ indicates following codepoint (or hex number) unicode. value want convert integer codepoint, have omit 2 first characters .substring(2)

you wil obtain following code:

int hex = integer.parseint(unicodestr.substring(2), 16);

Comments

Popular posts from this blog

java - nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet Hibernate+SpringMVC -

sql - Postgresql tables exists, but getting "relation does not exist" when querying -

asp.net mvc - breakpoint on javascript in CSHTML? -