使用par在带有国际字符的代码中格式化注释

时间:2021-11-28 20:18:09

I'm using Par (in linux) to get nice comments formatting quickly. The problem is that now I want to introduce comments that include some international characters, like áéíóú or äëïöü...

我正在使用Par(在linux中)快速获得很好的评论格式。问题是,现在我想介绍包含一些国际角色的评论,比如áéíóú或äëïöü......

The program Berkeley Par considers these international characters as 2 ASCII characters (I believe) and it outputs the comments somehow broken because it doesn't count characters properly.

Berkeley Par程序将这些国际字符视为2个ASCII字符(我相信),它会以某种方式输出注释,因为它不会正确计算字符数。

Did you face this problem before? Do you have any solution? Ideas?

你以前遇到过这个问题吗?你有什么解决方案吗?想法?

3 个解决方案

#1


You mean the code from Add multibyte characters support in "par" (or just the patches applied to the original source) don't work for you?

你的意思是“par”中添加多字节字符支持的代码(或者只是应用于原始源的补丁)对你不起作用?

Then maybe it is a problem with your shell or the font it uses. Are you sure the shell and font you use is able to reproduce unicode characters

那么也许你的shell或它使用的字体有问题。您确定您使用的shell和字体能够重现unicode字符

#2


Par, as distributed in Ubuntu from Hardy on, is supposed to handle multi-byte encodings.

从Hardy开始在Ubuntu中分发的Par应该处理多字节编码。

http://packages.ubuntu.com/hardy/par

#3


I've never even heard of this tool, but check out par 1.52.

我从来没有听说过这个工具,但请查看1.52。

The latest version of Par, released on 2001-Apr-29, tar'd and gzip'd. The only real change is better support for 8-bit character sets (as opposed to just 7-bit ASCII), but see also the release notes.

最新版本的Par,于2001年4月29日发布,tar'd和gzip'd。唯一真正的变化是对8位字符集的更好支持(而不仅仅是7位ASCII),但另请参阅发行说明。

Edit: On the page, see par_1.52-i18n.3.diff.gz:

编辑:在页面上,请参阅par_1.52-i18n.3.diff.gz:

A patch by Jérôme Pouiller that adds support for multibyte charsets (like UTF-8), plus Debian packaging. Copied from http://sysmic.org/par/debian/. See also his original announcement.

JérômePouiller的补丁增加了对多字节字符集(如UTF-8)和Debian打包的支持。复制自http://sysmic.org/par/debian/。另见他最初的公告。

#1


You mean the code from Add multibyte characters support in "par" (or just the patches applied to the original source) don't work for you?

你的意思是“par”中添加多字节字符支持的代码(或者只是应用于原始源的补丁)对你不起作用?

Then maybe it is a problem with your shell or the font it uses. Are you sure the shell and font you use is able to reproduce unicode characters

那么也许你的shell或它使用的字体有问题。您确定您使用的shell和字体能够重现unicode字符

#2


Par, as distributed in Ubuntu from Hardy on, is supposed to handle multi-byte encodings.

从Hardy开始在Ubuntu中分发的Par应该处理多字节编码。

http://packages.ubuntu.com/hardy/par

#3


I've never even heard of this tool, but check out par 1.52.

我从来没有听说过这个工具,但请查看1.52。

The latest version of Par, released on 2001-Apr-29, tar'd and gzip'd. The only real change is better support for 8-bit character sets (as opposed to just 7-bit ASCII), but see also the release notes.

最新版本的Par,于2001年4月29日发布,tar'd和gzip'd。唯一真正的变化是对8位字符集的更好支持(而不仅仅是7位ASCII),但另请参阅发行说明。

Edit: On the page, see par_1.52-i18n.3.diff.gz:

编辑:在页面上,请参阅par_1.52-i18n.3.diff.gz:

A patch by Jérôme Pouiller that adds support for multibyte charsets (like UTF-8), plus Debian packaging. Copied from http://sysmic.org/par/debian/. See also his original announcement.

JérômePouiller的补丁增加了对多字节字符集(如UTF-8)和Debian打包的支持。复制自http://sysmic.org/par/debian/。另见他最初的公告。