Bug 436378

Summary: Text files created with Kate are not empty, but they should be.
Product: [Applications] dolphin Reporter: RaLee <zakiryu>
Component: generalAssignee: Dolphin Bug Assignee <dolphin-bugs-null>
Status: RESOLVED NOT A BUG    
Severity: minor CC: kare.sars, kfm-devel
Priority: NOR    
Version First Reported In: 21.04.0   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

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!