Skip to content

Tag: unicode

Colored Emojis in Java Swing Labels

I was wondering how to dispaly colored emojis in swing. I have a feeling that the Swing (awt) font engine is unable to do this. I’ve tried using the windows emoji font (Segoe UI Emoji), but sadly it only displays the monochrome variants. Is there any UIManager-Property or Client-Property that I can set in order to get the non-monochrome variant

Remove character ‘u202A’ 8234 from string

I am trying to get character at 0 index in a string: So I use this function after I query contact, but I found strange result. Normal input & output: And this the strange input and result: So I try to debug this account and I found when app try to get character at 0 the return is ‘u202A’ 8234,

Replace Unicode escapes with the corresponding character

I’m trying to convert code points, such as u00FC, to the character it represents. An example to explain what I mean: First Console line: Input: Hallu00F6 Second Console line: And Now: Hallö EDIT: Because sometimes it didn’t work with multiple Unicodes in The Trombone Willy’s answer, here is the Code fixed: Answer Joao’s answer is probably the simplest, but this

Difference between uppercase and titlecase

What’s the difference between uppercase and titlecase. Frankly, I never heard of titlecase before. In java there are seperate methods for both: Character.isTitleCase(char) Character.isUpperCase(char) Some websites define it as follows: TitleCase: Matches characters that combine an uppercase letter with a lowercase letter, such as Nj and Dz But there must be more to it: the isTitleCase(char) method only accepts 1

Set two flags in Java regex.Pattern

I need a matcher like this: and the problem is that it is not simple ASCII. I know that in this particular case I could use [u00FCu00DC] for the ü, but I need to be a bit more general (building the regex from other matcher groups). So according to javadocs: By default, case-insensitive matching assumes that only characters in the

What is the difference between Character.isAlphabetic and Character.isLetter in Java?

What is the difference between Character.isAlphabetic() and Character.isLetter() in Java? When should one use one and when should one use the other? Answer According to the API docs, isLetter() returns true if the character has any of the following general category types: UPPERCASE_LETTER (Lu), LOWERCASE_LETTER (Ll), TITLECASE_LETTER (Lt), MODIFIER_LETTER (Lm), OTHER_LETTER (Lo). If we compare isAlphabetic(), it has the same

Is there a Java library like Perl 5’s Text::Unidecode?

Perl 5 has a module on CPAN named Text::Unidecode that transliterates Unicode into ASCII. So, for instance, if you hand it the string ““北亰 — it’s the best”” it hands back the string “”Bei Jing — it’s the best””. A quick search for Java libraries to do the same thing only turned up code that would strip Unicode characters or