[Fixed] Content Search - not work with some characters in ..
Forum rules
You might want to read this if you're looking for priority service
Please Include The Following Information
1) Your XYplorer Version (e.g., v28.00.0801)
2) Your Windows Version (e.g., Win 11)
3) Your Screen Scaling Percentage (e.g., 125%).
Use Your Profile Or Signature
We strongly recommend adding your Windows Version and Screen Scaling Percentage to the Location field in your Profile or to your Signature. That way, you only have to type them once, and we won't have to search for that vital information.
How To Attach Images
When attaching an Image, please use the Attachment tab at the bottom of your post and click "Add files".
You might want to read this if you're looking for priority service
1) Your XYplorer Version (e.g., v28.00.0801)
2) Your Windows Version (e.g., Win 11)
3) Your Screen Scaling Percentage (e.g., 125%).
We strongly recommend adding your Windows Version and Screen Scaling Percentage to the Location field in your Profile or to your Signature. That way, you only have to type them once, and we won't have to search for that vital information.
When attaching an Image, please use the Attachment tab at the bottom of your post and click "Add files".
-
Nolan
- Posts: 66
- Joined: 27 Nov 2013 05:23
[Fixed] Content Search - not work with some characters in ..
XY: fresh v16.50.0205
Mode: Normal
Type: Text
Match unicode: Yes
It seems some (not all) Traditional Chinese characters e.g. 虎 牛 狗 in an UTF-8 encoded txt file can't be identified by XY's Content Search. Performing a Content Search with any of those characters will not make the txt file appear in search result.
(If those characters exist In a Big5 encoded txt file, the Content Search works well w/o ticking "Match unicode".)
Mode: Normal
Type: Text
Match unicode: Yes
It seems some (not all) Traditional Chinese characters e.g. 虎 牛 狗 in an UTF-8 encoded txt file can't be identified by XY's Content Search. Performing a Content Search with any of those characters will not make the txt file appear in search result.
(If those characters exist In a Big5 encoded txt file, the Content Search works well w/o ticking "Match unicode".)
Last edited by Nolan on 11 Apr 2016 16:31, edited 1 time in total.
-
admin
- Site Admin
- Posts: 67271
- Joined: 22 May 2004 16:48
- Location: Win8.1, Win10, Win11, all @100%
- Contact:
Re: Content Search - not work with some characters in UTF-8
Untick "Match unicode".
FAQ | XY News RSS | XY X
-
Nolan
- Posts: 66
- Joined: 27 Nov 2013 05:23
Re: Content Search - not work with some characters in UTF-8
Content Search doesn't work with 虎 / 牛 / 狗 that exists in UTF-8 encoded txt files. However, at least it works with some other Traditional Chinese characters e.g. 貓 馬 鷹 in UTF-8 txt files if "Match unicode" is ticked.
Unticking "Match Unicode", and then performing a Content Search with any of 虎 牛 狗 貓 馬 鷹, will make any UTF-8 txt files containing the character not show up in search result.
Unticking "Match Unicode", and then performing a Content Search with any of 虎 牛 狗 貓 馬 鷹, will make any UTF-8 txt files containing the character not show up in search result.
-
oXYgen
- Posts: 43
- Joined: 26 May 2014 05:57
Re: Content Search - not work with some characters in UTF-8
I've created files with identical content "sample text" in different encodings (little-endian). Trying to search in "Normal" mode:

Could you explain how "Match unicode" checkbox works?
- without "Match unicode"
found: ASCII, UTF-8 (-BOM), UTF-8 (+BOM), UTF-16 (+BOM) not found: UTF-16 (-BOM), UTF-32 (-BOM), UTF-32 (+BOM)
- with "Match unicode"
found: UTF-16 (-BOM), UTF-32 (+BOM) not found: ASCII, UTF-8 (-BOM), UTF-32 (-BOM), UTF-8 (+BOM), UTF-16 (+BOM)
Could you explain how "Match unicode" checkbox works?
-
admin
- Site Admin
- Posts: 67271
- Joined: 22 May 2004 16:48
- Location: Win8.1, Win10, Win11, all @100%
- Contact:
Re: Content Search - not work with some characters in UTF-8
Works fine here. The only explanation would be that you are using BOM-less UTF-8 files AND you unticked "Configuration | Preview | Text preview | UTF-8 auto-detection".Nolan wrote:Content Search doesn't work with 虎 / 牛 / 狗 that exists in UTF-8 encoded txt files. However, at least it works with some other Traditional Chinese characters e.g. 貓 馬 鷹 in UTF-8 txt files if "Match unicode" is ticked.
Unticking "Match Unicode", and then performing a Content Search with any of 虎 牛 狗 貓 馬 鷹, will make any UTF-8 txt files containing the character not show up in search result.
FAQ | XY News RSS | XY X
-
admin
- Site Admin
- Posts: 67271
- Joined: 22 May 2004 16:48
- Location: Win8.1, Win10, Win11, all @100%
- Contact:
Re: Content Search - not work with some characters in UTF-8
What string did you search?oXYgen wrote:I've created files with identical content "sample text" in different encodings (little-endian). Trying to search in "Normal" mode:User guide states that a text string "Text" will match with "T0e0x0t0". Why it finds UTF-32 and skips UTF-16 when "Match unicode" is checked? Why it finds UTF-8 and UTF-16 when "Match unicode" is unchecked? Why presence of byte order mark (BOM) affects the results? I'm really confused
- without "Match unicode"
found: ASCII, UTF-8 (-BOM), UTF-8 (+BOM), UTF-16 (+BOM) not found: UTF-16 (-BOM), UTF-32 (-BOM), UTF-32 (+BOM)- with "Match unicode"
found: UTF-16 (-BOM), UTF-32 (+BOM) not found: ASCII, UTF-8 (-BOM), UTF-32 (-BOM), UTF-8 (+BOM), UTF-16 (+BOM)
Could you explain how "Match unicode" checkbox works?
BTW, UTF-32 is not supported in XY.
PS: "Match unicode" should probably be removed from the UI. It's not very useful and confusing without explanation.
FAQ | XY News RSS | XY X
-
oXYgen
- Posts: 43
- Joined: 26 May 2014 05:57
Re: Content Search - not work with some characters in UTF-8
I search "sample text" or just "text". It makes no differenceadmin wrote:What string did you search?
Why it finds UTF-32 (+BOM) that is actually "t000e000x000t000"? Why it finds UTF-16 (-BOM) but skips UTF-16 (+BOM)? The difference is 2 first bytes "FF FE" in UTF-16 (+BOM).admin wrote:BTW, UTF-32 is not supported in XY.
What if you include several checkboxes for encodings in a separate dialog box and replace "Match unicode" checkbox with "Encodings..." button?admin wrote:"Match unicode" should probably be removed from the UI.
-
admin
- Site Admin
- Posts: 67271
- Joined: 22 May 2004 16:48
- Location: Win8.1, Win10, Win11, all @100%
- Contact:
Re: Content Search - not work with some characters in UTF-8
1) Let's forget about "Match unicode". I will probably remove it. It's not necessary for most users.
2) All other searches work well as advertised. (As I said UTF-32 is not supported)
2) All other searches work well as advertised. (As I said UTF-32 is not supported)
FAQ | XY News RSS | XY X
-
oXYgen
- Posts: 43
- Joined: 26 May 2014 05:57
Re: Content Search - not work with some characters in UTF-8
UTF-16 (-BOM) is not found if "Match unicode" has not been checked. Are you about to combine both search results (with and without "Match unicode")?admin wrote:I will probably remove it.
-
admin
- Site Admin
- Posts: 67271
- Joined: 22 May 2004 16:48
- Location: Win8.1, Win10, Win11, all @100%
- Contact:
Re: Content Search - not work with some characters in UTF-8
UTF-16 without BOM is also not supported. I forgot to mention that. (Never met such a file in real life.)oXYgen wrote:UTF-16 (-BOM) is not found if "Match unicode" has not been checked.
That it works in this case with "Match unicode" checked is just a coincidence. It would not work for Chinese characters.
FAQ | XY News RSS | XY X
-
oXYgen
- Posts: 43
- Joined: 26 May 2014 05:57
Re: Content Search - not work with some characters in UTF-8
admin wrote:(As I said UTF-32 is not supported)
Please add this information to the User guideadmin wrote:UTF-16 without BOM is also not supported. I forgot to mention that.
-
Nolan
- Posts: 66
- Joined: 27 Nov 2013 05:23
Re: Content Search - not work with some characters in UTF-8
I use a fresh XY to test the problem. By default, "UTF-8 auto-detection" is on, and I never change it.
For the test, I created 2 .txt files: test_Big5.txt and test_UTF-8.txt, and put them in the same folder: TEST. test_Big5.txt is BIg5 encoded, and test_UTF-8.txt is UTF-8 encoded with BOM. Both .txt files have the same text content:
貓 馬 鷹
虎 牛 狗
XY's Preview shows the text content and decoding of each .txt file:
the text content and decoding of test_Big5.txt the text content and decoding of test_UTF-8.txt Search result of a Content Search: 貓 In folder: TEST when "Match unicode" is OFF: Search result of a Content Search: 貓 In folder: TEST when "Match unicode" is ON : Search result of a Content Search: 虎 In folder: TEST when "Match unicode" is OFF : Search result of a Content Search: 虎 In folder: TEST when "Match unicode" is ON :
貓 馬 鷹
虎 牛 狗
XY's Preview shows the text content and decoding of each .txt file:
the text content and decoding of test_Big5.txt the text content and decoding of test_UTF-8.txt Search result of a Content Search: 貓 In folder: TEST when "Match unicode" is OFF: Search result of a Content Search: 貓 In folder: TEST when "Match unicode" is ON : Search result of a Content Search: 虎 In folder: TEST when "Match unicode" is OFF : Search result of a Content Search: 虎 In folder: TEST when "Match unicode" is ON :
To see the attached files, you need to log into the forum.
-
admin
- Site Admin
- Posts: 67271
- Joined: 22 May 2004 16:48
- Location: Win8.1, Win10, Win11, all @100%
- Contact:
Re: Content Search - not work with some characters in UTF-8
OK, I see, and I could reproduce it.
The problem here is that Big5 has no BOM, and there is no safe way to detect a Big5 (or any other BOM-less) encoding by scanning the byte patterns. So you would have to tell XY the encoding of the file. This is currently not possible in content search.
Now in your case Big5 appears to be the system default so I would have expected that it works out of the box. I will check this now...
... well, it's complex and hard to debug. I have to switch back and forth between German and Chinese regional settings all the time, and need to compile the app for testing each time since the source code is garbled under Chinese regional settings. I finally thought I had it but for reasons I don't understand it failed. I'm currently out of ideas. Nevertheless I upload the beta version. Maybe it works at your end.
The problem here is that Big5 has no BOM, and there is no safe way to detect a Big5 (or any other BOM-less) encoding by scanning the byte patterns. So you would have to tell XY the encoding of the file. This is currently not possible in content search.
Now in your case Big5 appears to be the system default so I would have expected that it works out of the box. I will check this now...
... well, it's complex and hard to debug. I have to switch back and forth between German and Chinese regional settings all the time, and need to compile the app for testing each time since the source code is garbled under Chinese regional settings. I finally thought I had it but for reasons I don't understand it failed. I'm currently out of ideas. Nevertheless I upload the beta version. Maybe it works at your end.
FAQ | XY News RSS | XY X
-
oXYgen
- Posts: 43
- Joined: 26 May 2014 05:57
Re: Content Search - not work with some characters in UTF-8
Could you explain what it is used for? Example? I've searched the forum but found nothing related to practical usage of this featureadmin wrote:Renamed "Match unicode" to "Match wide strings". More correct, less confusing.
-
admin
- Site Admin
- Posts: 67271
- Joined: 22 May 2004 16:48
- Location: Win8.1, Win10, Win11, all @100%
- Contact:
Re: Content Search - not work with some characters in UTF-8
The tooltip explains it.
FAQ | XY News RSS | XY X
XYplorer Beta Club