Android Question UTF16 characters in the "high" ranges

Rusty

Well-Known Member
Licensed User
Longtime User
I am trying to display utf16 characters that are above 65000 and having difficulty getting it done.
FE4E6 is the American Flag (as an example).
How does one display this in a Webview, EditText or ???
Thanks in advance.
Rusty
 

Rusty

Well-Known Member
Licensed User
Longtime User
Good morning, Erel.
Thanks for all your help yesterday. If you look at my post #20 above, i find the need to be able to combine multiple diacritics into a single character.
I found some Java code that looks like it might handle the multiples.
B4X:
public static String composeHangul(String source) {
        int len = source.length();
        if (len == 0) return "";
        StringBuffer result = new StringBuffer();
        char last = source.charAt(0);            // copy first char
        result.append(last);

        for (int i = 1; i < len; ++i) {
            char ch = source.charAt(i);

            // 1. check to see if two current characters are L and V

            int LIndex = last - LBase;
            if (0 <= LIndex && LIndex < LCount) {
                int VIndex = ch - VBase;
                if (0 <= VIndex && VIndex < VCount) {

                    // make syllable of form LV

                    last = (char)(SBase + (LIndex * VCount + VIndex) * TCount);
                    result.setCharAt(result.length()-1, last); // reset last
                    continue; // discard ch
                }
            }

            // 2. check to see if two current characters are LV and T

            int SIndex = last - SBase;
            if (0 <= SIndex && SIndex < SCount && (SIndex % TCount) == 0) {
                int TIndex = ch - TBase;
                if (0 <= TIndex && TIndex <= TCount) {

                    // make syllable of form LVT

                    last += TIndex;
                    result.setCharAt(result.length()-1, last); // reset last
                    continue; // discard ch
                }
            }

            // if neither case was true, just add the character

            last = ch;
            result.append(ch);
        }
        return result.toString();
    }
Are you able to determine if this might help us out on combining the multiples?
Regards,
Rusty
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…