You are here: PSPad forum > Bug report / Hlášení chyb > Re: Issue copying text, text cut off
Posted by: tmpad | Date: 2024-11-22 09:40 | IP: IP Logged
I have one file where I can not copy the whole content to a new file using Ctrl-A, C and V.
I have other files in the same session where I can copy the whole content without problems.
The content is always cut off at the end of a code block. When I add lorem-ipsum text before that block, the situation remains the same. The content is cut off at the end of the code block.
When I compare the file with an older version, the relevant line is shown as different between the two files. From the older version I can copy the whole content. The new version is "UTF-8 no BOM" encoded, the old version is "ANSI Western European (1252)".
The relevant line looks like this " }}": Two blanks and then two curly braces.
When I move the cursor across the line in the old version, the status bar shows the correct character codes: $0020 $0020 $007D $007D.
When I do the same with the new version, the code for the second blank is not shown in the status bar. The cursor moves, but no code.
In the past I often had the "chinese character" issue with similar lines. It could be related.
The code is open source, I can provide you the two files. How?
I'm using 5.5.1 (815).
Posted by: pspad | Date: 2024-11-22 09:53 | IP: IP Logged
Hello
Isn't there any char $0000 in your text?
You can publish files on any public storage and put links here or send files as attachment to pspad support mail.
Edited 1 time(s). Last edit at 2024-11-22 09:55 by pspad.
Posted by: tmpad | Date: 2024-11-22 10:33 | IP: IP Logged
I sent you the two files. The relevant line is 383 in the newer version.
Edited 1 time(s). Last edit at 2024-11-22 10:36 by tmpad.
Posted by: pspad | Date: 2024-11-22 11:02 | IP: IP Logged
On the line 383, second char
Delete all chars before }} and write there 2x space
Posted by: pspad | Date: 2024-11-22 11:05 | IP: IP Logged
Maybe there isn't 0000 char, but there is wrong UTF-8 encoding, what causes this problem
If file doesn't contains any sign from upper part of the ASCII table, content of ANSI and UTF-8 is same. UTF-8 encodes only chars from the table upper part with 2 or 3 bytes.
Posted by: tmpad | Date: 2024-11-22 13:08 | IP: IP Logged
When I had the issue for the first time, actually a couple of month ago, I deleted the whole line and typed it in again. That did not solve the problem.
Today it solved the problem on that line, but at the same time created a "chinese character" issue some 200 lines earlier in the code.
I have been a loyal PSPad user for over 20 years, but my patience is gradually running out.
Posted by: pspad | Date: 2024-11-22 13:13 | IP: IP Logged
Hello. If there is "chinese" char, it means there is problem with UTF-8 encoding.
Encoding has mathematical rules to encode chars.
Open your file as ANSI, in the menu encoding change it to UTF-8 no BOM and save it.
You have no chars in your file what needs to be encoded into UTF-8, your file content should be same with ANSI and UTF-8 encoding.
Posted by: tmpad | Date: 2024-11-22 19:09 | IP: IP Logged
Quote:Open your file as ANSI, in the menu encoding change it to UTF-8 no BOM and save it.
That is exactly how I first derived the current branch from the old version. There are 23 commits between the old and the current version. Why doesn't the problem occur with every commit?
Quote:You have no chars in your file what needs to be encoded into UTF-8, your file content should be same with ANSI and UTF-8 encoding.
The latest version of the interpreter I'm using has now UTF-8 as the default encoding. I have to store all files as UTF-8, regardless of the content.
Editor PSPad - freeware editor, © 2001 - 2024 Jan Fiala, Hosted by Webhosting TOJEONO.CZ, design by WebDesign PAY & SOFT, code Petr Dvořák, Privacy policy and GDPR