Search for unicode text inside Windows XP

2019-07-14 22:22发布

Is there a way of searching for unicode characters inside a text file under Windows XP? For example suppose I wish to find text documents with the euro symbol. Although the standard XP search allows me to search for the euro symbol it does not produce any matches when I know they should be at least a few. Wingrep has the same issue. Is there any simple software/setting the I have missed?

2条回答
三岁会撩人
2楼-- · 2019-07-14 22:34

In windows or what ever else system you can find out that is it the document unicode (have a unicode character ) or not ?

To achieve this just use this simpl code, not that this code, written in C# and you should use your own equevalent.

public bool IsUnicode(string str)
{
 int asciiBytesCount = System.Text.Encoding.ASCII.GetByteCount(str);
 int unicodBytesCount = System.Text.Encoding.UTF8.GetByteCount(str);

 if (asciiBytesCount!=unicodBytesCount )
     return true;

 return false;
}

if you do not want to write any code and find out that , is document contain any unicode character just see the document (save) Type.

查看更多
戒情不戒烟
3楼-- · 2019-07-14 22:40

The input encoding of the search field (in Windows XP, UTF-16) may not match the encoding of the text file (probably UTF-8).

I haven't used this tool (freeware), but it might work for your needs.

查看更多
登录 后发表回答