# &#打头的生僻字可以批量替换或者有转Unicode的列表吗？

**URL:** <https://forum.freemdict.com/t/topic/17840>\
**Category:** 技术交流与词典编修\
**Tags:** 汉语\
**Created:** [2022 年12 月 9 日 08:52 UTC](https://forum.freemdict.com/t/topic/17840 "2022-12-09T08:52:44Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![lilysirius](https://forumcdn.freemdict.com/letter_avatar_proxy/v4/letter/l/958977/32.png) [@lilysirius](https://forum.freemdict.com/u/lilysirius)\
**Post date:** [2022 年12 月 9 日 08:52 UTC](https://forum.freemdict.com/t/topic/17840/1 "2022-12-09T08:52:44Z")

</div>

坛子里的汉语方言大词典的词头有很多生僻字都用的是&#打头的编码（html？），没办法检索。粘贴到搜索引擎里试了一下，点击搜索后会自动转成Unicode. 比如`不&#55386;&#56939;头`，搜索框里自动变成了不𦩫头。

有没有办法可以批量替换成Unicode啊？或者有&#到Unicode的列表也行。

* * *

搜了一圈，这个好像叫html entity，用的是UTF-16十进制编码

* * *

emeditor有个html/xml reference to Unicode可以批量转换，但是emeditor只有windows版，虚拟机太卡了。有没有不依赖于windows的解决办法？

---

<div class="post-metadata">

**Author:** ![surfactant](https://forumcdn.freemdict.com/letter_avatar_proxy/v4/letter/s/dbc845/32.png) [@surfactant](https://forum.freemdict.com/u/surfactant)\
**Post date:** [2022 年12 月 9 日 10:06 UTC](https://forum.freemdict.com/t/topic/17840/2 "2022-12-09T10:06:20Z")

</div>

emeditor 诚可贵，windows价更高，若为自由故，二者皆可抛？

---

<div class="post-metadata">

**Author:** ![sxingbai](https://forumcdn.freemdict.com/letter_avatar_proxy/v4/letter/s/919ad9/32.png) [@sxingbai](https://forum.freemdict.com/u/sxingbai)\
**Post date:** [2022 年12 月 9 日 11:09 UTC](https://forum.freemdict.com/t/topic/17840/3 "2022-12-09T11:09:44Z")

</div>

> [@lilysirius](#):
>
> &#打头的编码

&#后是十进制u码,把它转换为十六进制就是标准的u码

---

<div class="post-metadata">

**Author:** ![lilysirius](https://forumcdn.freemdict.com/letter_avatar_proxy/v4/letter/l/958977/32.png) [@lilysirius](https://forum.freemdict.com/u/lilysirius)\
**Post date:** [2022 年12 月 9 日 13:23 UTC](https://forum.freemdict.com/t/topic/17840/4 "2022-12-09T13:23:59Z")

</div>

研究了一下，html entity的编码是utf-16be十进制，先转化成了十六进制，再转化成bytes类型，最后decode就可以了

在python中，把html entity的编码放入string，用下面的函数就可以了。

```auto
def convHTML(string):
    hexL = [hex(int(c.strip('&#;'))).replace('0x', '') for c in string.split(';&#')]
    return bytes.fromhex(' '.join(hexL)).decode('utf-16be')

```

---

<div class="post-metadata">

**Author:** ![alexpeng](https://forumcdn.freemdict.com/user_avatar/forum.freemdict.com/alexpeng/32/19592_2.png) [@alexpeng](https://forum.freemdict.com/u/alexpeng)\
**Post date:** [2022 年12 月 9 日 13:38 UTC](https://forum.freemdict.com/t/topic/17840/5 "2022-12-09T13:38:07Z")

</div>

方法一：  
[Unicode编码转换 | Unicode在线转换 —在线工具 (sojson.com)](https://www.sojson.com/unicode.html)

方法二：  
汉语方言大词典–许宝华（切图版）20220721新版

> **[汉语方言大词典--许宝华（切图版）20220721新版 - MDict 词库资源区 - MDict Dictionaries - 掌上百科 -...](https://www.pdawiki.com/forum/forum.php?mod=viewthread&tid=47492)**
>
> 5、把代码换成汉字，外挂字体（包括cnki自造字体）。其中有部分汉字有unicode码，来不及替换了。拼音索引是足够使用的。但是，有特别兴趣，不妨替换。\<br\>6、重新制作全书 ... 汉语方言大词典--许宝华（切图版）20220721新版 ,掌上百科 - PDAWIKI

---

<div class="post-metadata">

**Author:** ![jcz777](https://forumcdn.freemdict.com/user_avatar/forum.freemdict.com/jcz777/32/60576_2.png) [@jcz777](https://forum.freemdict.com/u/jcz777)\
**Post date:** [2022 年12 月 9 日 14:05 UTC](https://forum.freemdict.com/t/topic/17840/6 "2022-12-09T14:05:16Z")

</div>

![未命名](https://forumcdn.freemdict.com/uploads/default/original/3X/f/5/f5154573f2d1cc5d08e4bbbef7f60c9e42e0dc65.png)

---

<div class="post-metadata">

**Author:** ![lilysirius](https://forumcdn.freemdict.com/letter_avatar_proxy/v4/letter/l/958977/32.png) [@lilysirius](https://forum.freemdict.com/u/lilysirius)\
**Post date:** [2022 年12 月 9 日 14:20 UTC](https://forum.freemdict.com/t/topic/17840/7 "2022-12-09T14:20:53Z")

</div>

谢谢推荐！不过新版的那个还是有不少问题，我随便找了一个原版是PUA的词头，𰽫𬙒，第二个字写的是􂶔，不是unicode，我这边显示也不对

---

<div class="post-metadata">

**Author:** ![alexpeng](https://forumcdn.freemdict.com/user_avatar/forum.freemdict.com/alexpeng/32/19592_2.png) [@alexpeng](https://forum.freemdict.com/u/alexpeng)\
**Post date:** [2022 年12 月 10 日 02:04 UTC](https://forum.freemdict.com/t/topic/17840/8 "2022-12-10T02:04:05Z")

</div>

下载后没仔细看过 😅

---

<div class="post-metadata">

**Author:** ![stonec](https://forumcdn.freemdict.com/letter_avatar_proxy/v4/letter/s/df788c/32.png) [@stonec](https://forum.freemdict.com/u/stonec)\
**Post date:** [2023 年2 月 8 日 06:18 UTC](https://forum.freemdict.com/t/topic/17840/9 "2023-02-08T06:18:53Z")

</div>

𬙒是扩展E的字，真可能还是继续PUA，只是没放在基本平面的PUA。Unicode最后两个平面(U+Fxxxx、U+10xxxx）也是PUA專区。

---

<div class="post-metadata">

**Author:** ![shaoshi](https://forumcdn.freemdict.com/user_avatar/forum.freemdict.com/shaoshi/32/14529_2.png) [@shaoshi](https://forum.freemdict.com/u/shaoshi)\
**Post date:** [2023 年4 月 4 日 02:45 UTC](https://forum.freemdict.com/t/topic/17840/10 "2023-04-04T02:45:15Z")

</div>

alexpeng收了这个新版吧？可以把mdx发出来供参考吗？只需要mdx，不需要mdd。

我把旧版导入过Access，不过有许多无法检索的词头很讨厌，得空想整一下。

---

<div class="post-metadata">

**Author:** ![alexpeng](https://forumcdn.freemdict.com/user_avatar/forum.freemdict.com/alexpeng/32/19592_2.png) [@alexpeng](https://forum.freemdict.com/u/alexpeng)\
**Post date:** [2023 年4 月 4 日 03:00 UTC](https://forum.freemdict.com/t/topic/17840/11 "2023-04-04T03:00:19Z")

</div>

找了一圈，您看看是不是这个。  
[漢語方言大詞典.mdx](https://forum.freemdict.com/uploads/short-url/o6XPJRpFPY69eWggyxVc8Apehwd.mdx) (3.3 MB)

---

<div class="post-metadata">

**Author:** ![shaoshi](https://forumcdn.freemdict.com/user_avatar/forum.freemdict.com/shaoshi/32/14529_2.png) [@shaoshi](https://forum.freemdict.com/u/shaoshi)\
**Post date:** [2023 年4 月 4 日 03:05 UTC](https://forum.freemdict.com/t/topic/17840/12 "2023-04-04T03:05:47Z")

</div>

劳烦翻找文档和辛苦上载，非常感谢。

把mdx内的说明贴出来，供有兴趣的书友参考：

1、感谢klwo2制作的原词典。  
2、主要为了手机查阅，做了正文切图。万一切掉部分内容，请原谅。  
3、根据自己的使用习惯，增加了拼音索引。原书拼音检字，也做了切图。  
4、正文的编号，从FY0001之类，改为0001FY。当从拼音检字查到某个汉字的页码，输入四位数的页码，就能快速点击，到达想查询的汉字那一个页面。  
5、把代码换成汉字，外挂字体（包括cnki自造字体）。其中有部分汉字有unicode码，来不及替换了。拼音索引是足够使用的。但是，有特别兴趣，不妨替换。  
6、重新制作全书所有词条的拼音索引。  
7、肯定会有错漏，望大家指出。

评论：

1 “万一切掉部分内容”是可能的，所以本坛旧的K大原整页版，还是比较让人放心的版本。

2.拼音索引对方言词典大大有用。因为很多字只知其音，不知其字。

3.新版更改的词头未必全对，但是要改旧版的词头时，检索新版，再对图像，改起来肯定会比较快。

---

<div class="post-metadata">

**Author:** ![alexpeng](https://forumcdn.freemdict.com/user_avatar/forum.freemdict.com/alexpeng/32/19592_2.png) [@alexpeng](https://forum.freemdict.com/u/alexpeng)\
**Post date:** [2023 年4 月 4 日 03:16 UTC](https://forum.freemdict.com/t/topic/17840/13 "2023-04-04T03:16:45Z")

</div>

对哦，还有个字体 😅  
[漢語方言大詞典.ttf](https://forum.freemdict.com/uploads/short-url/pvYFZyCUz6irImNyBFQHOcMNKdd.ttf) (2.0 MB)

不过这个词典并不显示字词头，这个字体用来干嘛的呢？看了一下，里面有宋体也有楷体，仅有5100余字。

---

<div class="post-metadata">

**Author:** ![shaoshi](https://forumcdn.freemdict.com/user_avatar/forum.freemdict.com/shaoshi/32/14529_2.png) [@shaoshi](https://forum.freemdict.com/u/shaoshi)\
**Post date:** [2023 年4 月 4 日 03:18 UTC](https://forum.freemdict.com/t/topic/17840/14 "2023-04-04T03:18:51Z")

</div>

我也不知道。不过先收起来，得空再研究吧。

方言的生僻字字型，说不定有用？

26-6-2023补充：

[求汉语方言大词典–许宝华（切图版）](https://forum.freemdict.com/t/topic/21841/5)

[《汉语方言大词典》知网版、mdx图像索引版都掉了“曱甴”这个词](https://forum.freemdict.com/t/topic/12221/7)。
