示例#1
0
        void LoadOneTable(
            XmlNode root,
            ref CodePage page)
        {
            Debug.Assert(page != null, "");
            // <characterSet name="Basic Arabic" ISOcode="33">
            XmlNodeList nodes = root.SelectNodes("code");

            /*
             * <code>
             *                  <marc>21</marc>
             *                  <ucs>0021</ucs>
             *                  <utf-8>21</utf-8>
             *                  <name>EXCLAMATION MARK</name>
             *          </code>
             * */

            for (int i = 0; i < nodes.Count; i++)
            {
                XmlNode   node       = nodes[i];
                CodeEntry entry      = new CodeEntry();
                string    strASCII   = DomUtil.GetElementText(node, "marc");
                string    strUnicode = DomUtil.GetElementText(node, "ucs");

                if (String.IsNullOrEmpty(strASCII) == true ||
                    String.IsNullOrEmpty(strUnicode) == true)
                {
                    continue;
                }

                entry.ASCII   = System.Convert.ToInt32(strASCII, 16);
                entry.Unicode = System.Convert.ToInt32(strUnicode, 16);
                page.Add(entry);
            }
        }