Notepad2e icon indicating copy to clipboard operation
Notepad2e copied to clipboard

Sorting adds line breaks under Japanese locale

Open ProgerXP opened this issue 5 years ago • 3 comments

Strange issue that occurs only if you switch Windows locale (Control panel > Region > Administrative > Non-Unicode programs > Change system locale, then reboot) to Japanese. I tested this both on XP and Win10, same result.

Create a document (UTF-8, CRLF) containing 3 or more lines of Ххххх (these are Cyrillic characters, not Latin). Sort (Alt+O) - you will get about 1 extra line break for every 2 lines so instead of just 3 Ххххх lines you get 5 lines, 2 of which are blank. On other locales (English, Russian) you get 3 lines, no blanks.

ProgerXP avatar Feb 16 '20 14:02 ProgerXP

The bug is because StrTrimA(pmsz, "\r\n"); , see https://github.com/zufuliu/notepad2/issues/168 and https://github.com/zufuliu/notepad2/commit/7192b4092dcc1dd874e34ef3fdb3bfbad81356f8

zufuliu avatar Aug 09 '20 09:08 zufuliu

Fixed.

cshnik avatar Oct 19 '20 16:10 cshnik

Possible, it worth to document that, n2e_StrTrimA only works when pszTrimChars doesn't contains DBCS trail bytes (see Scintilla's Document::IsDBCSTrailByteInvalid() method), it absolutely works for C0 control characters (\n\r\t\v\f space, etc.).

zufuliu avatar Oct 20 '20 14:10 zufuliu