/*
 * SDK Pullenti Unitext, version 4.33, fabruary 2026. Copyright (c) 2013-2026, Pullenti. All rights reserved. 
 * Non-Commercial Freeware and Commercial Software. 
 * This class is generated using the converter Unisharping (www.unisharping.ru) from Pullenti C# project. 
 * The latest version of the code is available on the site www.pullenti.ru
 */

package com.pullenti.unitext.internal.misc;

public class WebdingsHelper {


    private static java.util.HashMap<Integer, Character> m_Convert;

    public static char getUnicode(int code) {
        char res;
        com.pullenti.unisharp.Outargwrapper<Character> wrapres172 = new com.pullenti.unisharp.Outargwrapper<Character>();
        boolean inoutres173 = com.pullenti.unisharp.Utils.tryGetValue(m_Convert, code, wrapres172);
        res = (wrapres172.value != null ? wrapres172.value : 0);
        if (inoutres173) 
            return res;
        else 
            return (char)0;
    }

    public static String getUnicodeString(String str) {
        StringBuilder res = new StringBuilder();
        for (char c : str.toCharArray()) {
            char ch = getUnicode((int)c);
            if (ch != ((char)0)) 
                res.append(ch);
            else 
                res.append("?");
        }
        return res.toString();
    }
    public WebdingsHelper() {
    }
    
    static {
        m_Convert = new java.util.HashMap<Integer, Character>();
        int[] data = new int[] {0x33, 9204, 0x34, 9205, 0x35, 9206, 0x36, 9207, 0x37, 9194, 0x38, 9193, 0x39, 9198, 0x3A, 9197, 0x3B, 9208, 0x3C, 9209, 0x3D, 9210, 0x60, 11156, 0x61, 10004, 0x63, 9633, 0x67, 9632, 0x6E, 9899, 0x73, 10067, 0x77, 9971, 0x79, 8854, 0x7C, 124, 0x87, 9975, 0x98, 10031, 0xD9, 9729, 0xE8, 9413, 0xE9, 9855};
        for (int i = 0; i < (data.length - 1); i += 2) {
            if (data[i] < 0xFFFF) {
                if (!m_Convert.containsKey(data[i])) {
                    int cod = data[i + 1] & 0xFFFF;
                    m_Convert.put(data[i], (char)cod);
                }
            }
        }
    }
}
