[Fixed] Content Search - not work with some characters in ..

Things you’d like to miss in the future...
Forum rules
You might want to read this if you're looking for priority service

:info: 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%).

:info: 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.

:info: How To Attach Images
When attaching an Image, please use the Attachment tab at the bottom of your post and click "Add files".
oXYgen
Posts: 43
Joined: 26 May 2014 05:57

Re: Content Search - not work with some characters in UTF-8

Post by oXYgen »

admin wrote:The tooltip explains it.
Ok. I've read this in the User guide as well:

Code: Select all

Will match a string "Text" with "T0e0x0t0".
As I understand it will match UTF-16 LE encoding? Right? I've written above that "Match unicode" couldn't find UTF-16 (+BOM). And you have said that UTF-16 (-BOM) is not supported at all.

So what does the tooltip explain? :?:

Nolan
Posts: 66
Joined: 27 Nov 2013 05:23

Re: Content Search - not work with some characters in UTF-8

Post by Nolan »

admin wrote: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 search problem still exists in v16.50.0212. I did same test in latest build, and got identical result as in older version.

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

Post by admin »

Could you please click Help | Various Information and post the results, this part of it:

Code: Select all

System Locale ID: 1031 (de-DE)
Thread Locale ID: 1031 (de-DE)
Default ANSI Code Page: 1252  (ANSI - Lateinisch I)
Active Code Page: 1252  (ANSI - Lateinisch I)
DBCS Code Page: No

Nolan
Posts: 66
Joined: 27 Nov 2013 05:23

Re: Content Search - not work with some characters in UTF-8

Post by Nolan »

admin wrote:Could you please click Help | Various Information and post the results, this part of it:

Code: Select all

System Locale ID: 1031 (de-DE)
Thread Locale ID: 1031 (de-DE)
Default ANSI Code Page: 1252  (ANSI - Lateinisch I)
Active Code Page: 1252  (ANSI - Lateinisch I)
DBCS Code Page: No
------------------------------------------------------------------------------------
System Locale ID: 1028 (zh-TW)
Thread Locale ID: 1028 (zh-TW)
Default ANSI Code Page: 950 (ANSI/OEM - Traditional Chinese Big5)
Active Code Page: 950 (ANSI/OEM - Traditional Chinese Big5)
DBCS Code Page: Yes
------------------------------------------------------------------------------------
 

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

Post by admin »

oXYgen wrote:
admin wrote:The tooltip explains it.
Ok. I've read this in the User guide as well:

Code: Select all

Will match a string "Text" with "T0e0x0t0".
As I understand it will match UTF-16 LE encoding? Right? I've written above that "Match unicode" couldn't find UTF-16 (+BOM). And you have said that UTF-16 (-BOM) is not supported at all.

So what does the tooltip explain? :?:
I realized that probably nobody (apart from programmers) knows (or needs to know) what wide strings are. So I finally did what I planned already yesterday: I removed the whole option. Nobody really needs 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

Post by admin »

Nolan wrote:
admin wrote:Could you please click Help | Various Information and post the results, this part of it:

Code: Select all

System Locale ID: 1031 (de-DE)
Thread Locale ID: 1031 (de-DE)
Default ANSI Code Page: 1252  (ANSI - Lateinisch I)
Active Code Page: 1252  (ANSI - Lateinisch I)
DBCS Code Page: No
------------------------------------------------------------------------------------
System Locale ID: 1028 (zh-TW)
Thread Locale ID: 1028 (zh-TW)
Default ANSI Code Page: 950 (ANSI/OEM - Traditional Chinese Big5)
Active Code Page: 950 (ANSI/OEM - Traditional Chinese Big5)
DBCS Code Page: Yes
------------------------------------------------------------------------------------
 
Thanks.

When you show test_Big5.txt in the Preview tab you see the Chinese characters right away without selecting "Big5" from the orange button dropdown menu?

Nolan
Posts: 66
Joined: 27 Nov 2013 05:23

Re: Content Search - not work with some characters in UTF-8

Post by Nolan »

admin wrote: When you show test_Big5.txt in the Preview tab you see the Chinese characters right away without selecting "Big5" from the orange button dropdown menu?
Yes.

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

Post by admin »

I seem to be getting somewhere. Please try the latest beta (v16.50.0215).

oXYgen
Posts: 43
Joined: 26 May 2014 05:57

Re: Content Search - not work with some characters in UTF-8

Post by oXYgen »

admin wrote:I removed the whole option. Nobody really needs it.
Yep :appl: Its effect was unclear and unpredictable.

I'm just trying to clarify. Wide characters in Windows are 2-byte wchar_t. If you add trailing zeros to wide chars you probably want to create surrogate pairs. Only code points bigger than U+FFFF need surrogate pairs. ASCII codes from 0-127 are identical to Unicode. So if you want to find "Text" you don't really need to match it with "T0e0x0t0".

Nolan
Posts: 66
Joined: 27 Nov 2013 05:23

Re: Content Search - not work with some characters in UTF-8

Post by Nolan »

test_UTF-8.txt has the same text content as test_Big5.txt, but v16.50.0215's Content Search only finds 1 text file: test_Big5.txt.

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

Post by admin »

Weird, it works fine here when I switch Windows to Big5.

This is the raw view of my test_UTF-8.txt:

Code: Select all

00000000: EF BB BF E8 B2 93 20 E9 A6 AC 20 E9 B7 B9 0D 0A ; 貓 馬 鷹..
00000010: E8 99 8E 20 E7 89 9B 20 E7 8B 97                ; 虎 牛 狗     
Is it identical to yours?

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

Post by admin »

oXYgen wrote:
admin wrote:I removed the whole option. Nobody really needs it.
Yep :appl: Its effect was unclear and unpredictable.

I'm just trying to clarify. Wide characters in Windows are 2-byte wchar_t. If you add trailing zeros to wide chars you probably want to create surrogate pairs. Only code points bigger than U+FFFF need surrogate pairs. ASCII codes from 0-127 are identical to Unicode. So if you want to find "Text" you don't really need to match it with "T0e0x0t0".
The original use of this option was to provide an easy way to find text in wide string resources in binary files.

Nolan
Posts: 66
Joined: 27 Nov 2013 05:23

Re: Content Search - not work with some characters in UTF-8

Post by Nolan »

admin wrote:Weird, it works fine here when I switch Windows to Big5.

This is the raw view of my test_UTF-8.txt:

Code: Select all

00000000: EF BB BF E8 B2 93 20 E9 A6 AC 20 E9 B7 B9 0D 0A ; 貓 馬 鷹..
00000010: E8 99 8E 20 E7 89 9B 20 E7 8B 97                ; 虎 牛 狗     
Is it identical to yours?
My test_UTF-8.txt:
RawView_UTF-8_txt.png
 
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

Post by admin »

OK, identical. But I have another idea. Wait for next beta...

Nolan
Posts: 66
Joined: 27 Nov 2013 05:23

Re: Content Search - not work with some characters in UTF-8

Post by Nolan »

v16.50.0216's Content Search finds 0 item ...

Post Reply