Potential Bug With Copying Contents of Text Files Containing Special Characters

Things you’d like to miss in the future...
Post Reply
Macca
Posts: 4
Joined: 02 Aug 2017 11:24

Potential Bug With Copying Contents of Text Files Containing Special Characters

Post by Macca »

Hi there,

First, I'm a long time user of XYPlorer and it makes my day to day life far easier and more efficient (I love it :) ) - So a very big thank you for an amazing piece of software.

I think I've found a bit of a bug when using the 'Copy the textual contents of the focused List item' functionality where the text file contains special characters.

For example;

If you have a text file with the following in it

'Åland Islander'

and you use the copy text contents functionality on it, you get the following in your clipboard;

NELland Islander'

With the NEL being a UTF Next Line.

I've not managed to find a way around this as yet, so I think it may well be a bug...?

Cheers

Macca

highend
Posts: 13274
Joined: 06 Feb 2011 00:33

Re: Potential Bug With Copying Contents of Text Files Containing Special Characters

Post by highend »

A way around this: Save the document as "UTF-16 LE with BOM"

Works fine with your example
One of my scripts helped you out? Please donate via Paypal

admin
Site Admin
Posts: 60357
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: Potential Bug With Copying Contents of Text Files Containing Special Characters

Post by admin »

Could you send me that text file for testing?

Macca
Posts: 4
Joined: 02 Aug 2017 11:24

Re: Potential Bug With Copying Contents of Text Files Containing Special Characters

Post by Macca »

admin wrote:Could you send me that text file for testing?
Sure. no problems (should be attached to this post)
Attachments
Xyplorer_test.zip
(185 Bytes) Downloaded 31 times

admin
Site Admin
Posts: 60357
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: Potential Bug With Copying Contents of Text Files Containing Special Characters

Post by admin »

The contents of the file are copied to clipboard byte by byte. I cannot detect any difference.

The file format is "UTF-8 without BOM", and that's what you also get in the clipboard.

I can't really see any problem. :|

Macca
Posts: 4
Joined: 02 Aug 2017 11:24

Re: Potential Bug With Copying Contents of Text Files Containing Special Characters

Post by Macca »

Hi there,

Sorry for the delayed reply - I've been on holiday for a few weeks :)

I'm a bit confused now as I've tried this on several machines and always get the same results.

For clarity, my steps are;
  • Open the attached 'Xyplorer_test.zip' and extract the 'Xyplorer_test.txt' to my PC
  • Use the 'Copy the textual contents of the focused List item' functionality on the Xyplorer_test.txt' file
  • Paste the contents of your clipboard into Notepad and you get 'Åland Islander'
  • Paste the contents of your clipboard into Notepad++ and you get ''ÃNELland Islander''
  • If you open up 'Xyplorer_test.txt' in either Notepad or Notepad++, select / copy the text and then paste it into Notepad or Notepad++, you get the expected result of 'Åland Islander'
Do you not see this behavior?

Thanks

Macca

admin
Site Admin
Posts: 60357
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: Potential Bug With Copying Contents of Text Files Containing Special Characters

Post by admin »

I see the same, but it's not a problem of XYplorer.

You can verify using this script

Code: Select all

charview <clipboard>;
or using this script

Code: Select all

echo hexdump(<clipboard>);
that the file's bytes are correctly copied to the clipboard.

The problem is caused by Notepad / Notepad ++ and how they interprete BOM-less UTF-8 on pasting.

admin
Site Admin
Posts: 60357
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: Potential Bug With Copying Contents of Text Files Containing Special Characters

Post by admin »

:maf: Wait a moment. Now I see it's the other way round! XYplorer should NOT copy the text raw byte by raw byte, but the interpreted UTF8! The function is called "Text" not "Bytes". So you were totally right!

Wait for the next version...

Macca
Posts: 4
Joined: 02 Aug 2017 11:24

Re: Potential Bug With Copying Contents of Text Files Containing Special Characters

Post by Macca »

admin wrote::maf: Wait a moment. Now I see it's the other way round! XYplorer should NOT copy the text raw byte by raw byte, but the interpreted UTF8! The function is called "Text" not "Bytes". So you were totally right!

Wait for the next version...
You Sir, are a star!

I thought I was going Mad!

:)

Post Reply