Bug 436378 - Text files created with Kate are not empty, but they should be.
Summary: Text files created with Kate are not empty, but they should be.
Status: RESOLVED NOT A BUG
Alias: None
Product: dolphin
Classification: Applications
Component: general (show other bugs)
Version: 21.04.0
Platform: Arch Linux Linux
: NOR minor
Target Milestone: ---
Assignee: Dolphin Bug Assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-04-29 21:56 UTC by RaLee
Modified: 2021-04-30 10:30 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description RaLee 2021-04-29 21:56:52 UTC
SUMMARY
Text files created with Kate are not empty, but they should be.

STEPS TO REPRODUCE
Create a text file via Kate called "kate.txt".
(Right-click, Create New, Text File)

OBSERVED RESULT
A non-empty file was created.
$ cat kate.txt | wc -m
2
$ cat kate.txt | wc -l
1

EXPECTED RESULT
It should be totally empty instead.
$ touch touch.txt
$ cat touch.txt | wc -m
0
$ cat touch.txt | wc -l
0

SOFTWARE/OS VERSIONS
Operating System: Arch Linux
KDE Plasma Version: 5.21.4
KDE Frameworks Version: 5.81.0
Qt Version: 5.15.2
Kernel Version: 5.11.15-arch1-2
OS Type: 64-bit
Graphics Platform: X11
Comment 1 Kåre Särs 2021-04-30 09:37:16 UTC
Hmm...

This does not sounds like it would be Kate that creates this text file... 
"(Right-click, Create New, Text File)" sounds like it is Dolphin that creates the file.

Trying to create a new empty file in Kate and saving it creating and empty text file of 0 bytes.

The file creation in dolphin is actually a feature. The two bytes at the beginning of the file is the UTF8 BOM marker that tells editors and mime systems that this is a UTF8 encoded text file.
Comment 2 RaLee 2021-04-30 10:30:32 UTC
Yes, I mixed up Dolphin and Kate (I meant Dolphin).
Good to know that it is a feature, thanks!