/*
 * 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.word;

public class FcCompressedMapping {

    private static java.util.HashMap<Byte, Short> map;

    public static char getChar(byte code) {
        if (code < ((byte)0x80)) 
            return (char)code;
        else {
            short value;
            com.pullenti.unisharp.Outargwrapper<Short> wrapvalue526 = new com.pullenti.unisharp.Outargwrapper<Short>();
            boolean inoutres527 = com.pullenti.unisharp.Utils.tryGetValue(map, code, wrapvalue526);
            value = (wrapvalue526.value != null ? wrapvalue526.value : 0);
            if (inoutres527) 
                return (char)value;
            else 
                return (char)code;
        }
    }

    public static char[] getCharsArr(byte[] data, int offset, int count) {
        char[] result = new char[count];
        getChars(data, offset, count, result, 0);
        return result;
    }

    public static void getChars(byte[] data, int offset, int count, char[] output, int outputOffset) {
        for (int i = 0; i < count; i++) {
            output[outputOffset + i] = getChar(data[offset + i]);
        }
    }

    public FcCompressedMapping() {
    }
    
    static {
        map = new java.util.HashMap<Byte, Short>();
        map.put((byte)0x82, (short)0x201A);
        map.put((byte)0x83, (short)0x0192);
        map.put((byte)0x84, (short)0x201E);
        map.put((byte)0x85, (short)0x2026);
        map.put((byte)0x86, (short)0x2020);
        map.put((byte)0x87, (short)0x2021);
        map.put((byte)0x88, (short)0x02C6);
        map.put((byte)0x89, (short)0x2030);
        map.put((byte)0x8A, (short)0x0160);
        map.put((byte)0x8B, (short)0x2039);
        map.put((byte)0x8C, (short)0x0152);
        map.put((byte)0x91, (short)0x2018);
        map.put((byte)0x92, (short)0x2019);
        map.put((byte)0x93, (short)0x201C);
        map.put((byte)0x94, (short)0x201D);
        map.put((byte)0x95, (short)0x2022);
        map.put((byte)0x96, (short)0x2013);
        map.put((byte)0x97, (short)0x2014);
        map.put((byte)0x98, (short)0x02DC);
        map.put((byte)0x99, (short)0x2122);
        map.put((byte)0x9A, (short)0x0161);
        map.put((byte)0x9B, (short)0x203A);
        map.put((byte)0x9C, (short)0x0153);
        map.put((byte)0x9F, (short)0x0178);
    }
}
