[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: UTF-8 compatible alternative to fold(1)?



感觉您可以考虑去GNU coreutils报告个bug?不支持utf-8确实是个问题。不过估计解决起来也挺麻烦,可能要手动指定下编码。如果涉及中英混排,现在的--spaces选项也是个问题。

CHEN, Xing / 陈醒



2011/3/29 Zhang Weiwu, Beijing <zhangweiwu@realss.com>:
> Hello. What if I wish to fold a text file that is encoded in UTF-8? It
> seems to fail for me, and I don't know of any other tools that can
> replace the functionality of fold(1).
>
> Reproduce:
>
> $ echo '公元1126年公子遥被骆冬黄袍加身,欲挽狂澜于既倒。康王赵构招来十大门派掌门集结于汴京,赵构劝说公子遥放弃皇位不成遂下诏罢免公子遥武林盟主尊号,十大门派并击退公子遥,骆冬为公子遥殿后而战死。' | fold -w 130
>
> The output's last fold breaks a single ideograph to two, producing 3 characters of junk text.
>
> Thanks in advance!
>
>
> --
> 我的博客:
> http://zhangweiwu.ixiezi.com/
> 网站进化论 --写给需要网站或后悔有了网站的人
>
>
> --
> To UNSUBSCRIBE, email to debian-chinese-gb-REQUEST@lists.debian.org
> with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
> Archive: [🔎] 4D92AF6E.2060109@realss.com">http://lists.debian.org/[🔎] 4D92AF6E.2060109@realss.com
>
>

Reply to: