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

UTF-8 compatible alternative to fold(1)?

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).


$ 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!

网站进化论 --写给需要网站或后悔有了网站的人

Reply to: