hstr icon indicating copy to clipboard operation
hstr copied to clipboard

Does hstr support unicode?

Open rogerdehe opened this issue 6 years ago • 3 comments

I am from China, I find that when I type chinese, it will become something strange.

For example:

echo 中文

press Ctrl + r, it become:

echo 中惶<ffffffff><ffffffff>

rogerdehe avatar Jul 21 '17 13:07 rogerdehe

Let me do some experiments with Chinese - my language is čeština and it works nicely, however, it might be that I/you may need to use a different library. I use ncursesw (note w), but there is a fallback (to ncurses) in case that wide version cannot be found in your system - check https://github.com/dvorka/hstr/blob/master/configure.ac

Can you please check that ncursesw is installed in your system (for instance using dpkg -l | grep ncursesw)?

dvorka avatar Sep 30 '17 09:09 dvorka

我也遇到了这个问题,瞅着乱糟糟的中文挺别扭。 我排查了一下,是因为zshell 写.zsh_history文件时,没有采用标准的utf8,写入和读出时对一些字符做了处理。而在hstr中直接按utf8读文件,这样读到的原始内容就有问题。(你如果使用编辑器直接在history文件中添加中文,那么在hstr中就是正确的。同样在bash 中是没有问题的)

1.网上有处理zsh_history特殊格式的代码片段,但我测试了并没有用。 2.针对zsh在.zshrc中设置LANG为UTF-8是不起作用的。 3.然后看了zsh的源码,发现有点乱,看不下去,希望有人接力。。。

Sorry for this Non-English content, trans is too hard for me.

ZDL-Git avatar Aug 19 '20 08:08 ZDL-Git

Fixed by 04cee3c - will be released w/ 2.4.0

dvorka avatar Dec 03 '21 07:12 dvorka