# 使用mdict-utils遇到的一个问题

**URL:** <https://forum.freemdict.com/t/topic/15957>\
**Category:** 软件经验交流展望\
**Created:** [2022 年10 月 4 日 12:20 UTC](https://forum.freemdict.com/t/topic/15957 "2022-10-04T12:20:36Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

作者： ![glacierlee](https://forumcdn.freemdict.com/user_avatar/forum.freemdict.com/glacierlee/32/96873_2.png) [@glacierlee](https://forum.freemdict.com/u/glacierlee)\
发布日期： [2022 年10 月 4 日 12:20 UTC](https://forum.freemdict.com/t/topic/15957/1 "2022-10-04T12:20:36Z")

</div>

我用mdict-utils时碰到了错误，请问有群友遇到过吗？

命令：mdict-utils.exe -x “G:\Mdict\test.mdx” --exdb -d “G:\Mdict\Temp”

错误信息： utf-16-le’ codec can’t decode byte 0x30 in position 2: truncated data

---

<div class="post-metadata">

作者： ![glacierlee](https://forumcdn.freemdict.com/user_avatar/forum.freemdict.com/glacierlee/32/96873_2.png) [@glacierlee](https://forum.freemdict.com/u/glacierlee)\
发布日期： [2022 年10 月 4 日 12:26 UTC](https://forum.freemdict.com/t/topic/15957/2 "2022-10-04T12:26:00Z")

</div>

找到原因了  
 ![image](https://forumcdn.freemdict.com/uploads/default/original/3X/7/1/7114ddc661d80934c1985298767dff52832ffa79.png)

---

<div class="post-metadata">

作者： ![hkreporter](https://forumcdn.freemdict.com/letter_avatar_proxy/v4/letter/h/41988e/32.png) [@hkreporter](https://forum.freemdict.com/u/hkreporter)\
发布日期： [2022 年10 月 4 日 13:17 UTC](https://forum.freemdict.com/t/topic/15957/3 "2022-10-04T13:17:27Z")

</div>

遇到过，请教是怎么解决的？

---

<div class="post-metadata">

作者： ![hua](https://forumcdn.freemdict.com/user_avatar/forum.freemdict.com/hua/32/11090_2.png) [@hua](https://forum.freemdict.com/u/hua)\
发布日期： [2022 年10 月 4 日 13:19 UTC](https://forum.freemdict.com/t/topic/15957/4 "2022-10-04T13:19:01Z")

</div>

所有文件都使用 UTF8。

---

<div class="post-metadata">

作者： ![glacierlee](https://forumcdn.freemdict.com/user_avatar/forum.freemdict.com/glacierlee/32/96873_2.png) [@glacierlee](https://forum.freemdict.com/u/glacierlee)\
发布日期： [2022 年10 月 4 日 13:21 UTC](https://forum.freemdict.com/t/topic/15957/5 "2022-10-04T13:21:28Z")

</div>

对的，这其实也暴露出这个工具的一个缺点，不能提取编码是UTF16的mdx内容

---

<div class="post-metadata">

作者： ![hkreporter](https://forumcdn.freemdict.com/letter_avatar_proxy/v4/letter/h/41988e/32.png) [@hkreporter](https://forum.freemdict.com/u/hkreporter)\
发布日期： [2022 年10 月 4 日 13:23 UTC](https://forum.freemdict.com/t/topic/15957/6 "2022-10-04T13:23:30Z")

</div>

问题是怎么修改mdx的编码？  
比如之前用utils提取陆谷孙英汉大的词头，提取到AAAS卡住报错，也是编码问题，因为下一个词头是AAA²。

---

<div class="post-metadata">

作者： ![glacierlee](https://forumcdn.freemdict.com/user_avatar/forum.freemdict.com/glacierlee/32/96873_2.png) [@glacierlee](https://forum.freemdict.com/u/glacierlee)\
发布日期： [2022 年10 月 4 日 13:49 UTC](https://forum.freemdict.com/t/topic/15957/7 "2022-10-04T13:49:43Z")

</div>

只能用MdxExport了

---

<div class="post-metadata">

作者： ![amob](https://forumcdn.freemdict.com/user_avatar/forum.freemdict.com/amob/32/14630_2.png) [@amob](https://forum.freemdict.com/u/amob)\
发布日期： [2023 年10 月 6 日 12:39 UTC](https://forum.freemdict.com/t/topic/15957/8 "2023-10-06T12:39:25Z")

</div>

明明没写可以解包1.2版本的mdx，结果部分可以，部分不可以。（源文本都是UTF-8 NO BOM，非Compact HTML) 不知道具体原因。
