Search for unicode text inside Windows XP

假如想象 提交于 2020-02-04 08:08:33

问题


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?


回答1:


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.




回答2:


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.



来源:https://stackoverflow.com/questions/2063049/search-for-unicode-text-inside-windows-xp

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!