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
Post a Comment