If you want to flip the code yourself, one of the data sources is the Unihan Radical-Stroke Counts database, from the Unicode Consortium, Link to the Technical Report 38 section that describes these fields.
Note that the number of strokes of an ideographic symbol is based on the structure (or morphology) of the symbol displayed, that is, on its glyph. Glyph morphology is a function of the font style, especially if the font complies with traditional Chinese, simplified Chinese, or Japanese conventions. But character codes in Java are usually based on the Unicode standard, which combines characters from all these conventions under one character code.
So, you will need external information to tell you which agreement your text uses. This, in turn, tells you which Unihan database field to use. If you know that your Chinese text strings are simplified or all traditional Chinese, then you have enough information.
Also check out the Chinese character web interface , which serves data from the Unihan database.
source share