/// <summary> /// creates the tagged codeset component to insert into an IOR /// </summary> /// <returns></returns> private static TaggedComponent CreateCodesetComponent(Codec codec, int nativeCharSet, int nativeWCharSet) { Array wCharSets = Enum.GetValues(s_wCharSetType); Array charSets = Enum.GetValues(s_charSetType); int[] wCharSetCodes = new int[wCharSets.Length]; int[] charSetCodes = new int[charSets.Length]; for (int i = 0; i < wCharSets.Length; i++) // Array.CopyTo doesn't work with mono for this case { wCharSetCodes[i] = (int)wCharSets.GetValue(i); } for (int i = 0; i < charSets.Length; i++) // Array.CopyTo doesn't work with mono for this case { charSetCodes[i] = (int)charSets.GetValue(i); } Services.CodeSetComponentData codeSetCompData = new Services.CodeSetComponentData(nativeCharSet, charSetCodes, nativeWCharSet, wCharSetCodes); return(new TaggedComponent(TAG_CODE_SETS.ConstVal, codec.encode_value(codeSetCompData))); }
/// <summary> /// creates the tagged codeset component to insert into an IOR /// </summary> /// <returns></returns> private static TaggedComponent CreateCodesetComponent(Codec codec, int nativeCharSet, int nativeWCharSet) { Array wCharSets = Enum.GetValues(s_wCharSetType); Array charSets = Enum.GetValues(s_charSetType); int[] wCharSetCodes = new int[wCharSets.Length]; int[] charSetCodes = new int[charSets.Length]; for (int i = 0; i < wCharSets.Length; i++) { // Array.CopyTo doesn't work with mono for this case wCharSetCodes[i] = (int)wCharSets.GetValue(i); } for (int i = 0; i < charSets.Length; i++) { // Array.CopyTo doesn't work with mono for this case charSetCodes[i] = (int)charSets.GetValue(i); } Services.CodeSetComponentData codeSetCompData = new Services.CodeSetComponentData(nativeCharSet, charSetCodes, nativeWCharSet, wCharSetCodes); return new TaggedComponent(TAG_CODE_SETS.ConstVal, codec.encode_value(codeSetCompData)); }