Bug 256053 - Files saved as UTF-16 are not really in that encoding
Summary: Files saved as UTF-16 are not really in that encoding
Status: RESOLVED FIXED
Alias: None
Product: kate
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-11-04 15:40 UTC by Egon Willighagen
Modified: 2011-06-24 22:45 UTC (History)
0 users

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


Attachments
File save with Kate which is supposed to be in the UTF-16 encoding, but not detected as such by other softwares. (286 bytes, text/plain)
2010-11-04 15:40 UTC, Egon Willighagen
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Egon Willighagen 2010-11-04 15:40:12 UTC
Created attachment 53130 [details]
File save with Kate which is supposed to be in the UTF-16 encoding, but not detected as such by other softwares.

Version:           unspecified (using KDE 4.5.2) 
OS:                Linux

When I save a file as UTF-16, then other programs disagree on the encoding, whereas this problem does not occur with UTF-8 and ISO 8859-1 files save with Kate.

'file' reports for three files created with Kate:

$ file *.txt
iso8859-1.txt: ISO-8859 text, with no line terminators
utf16.txt:     data
utf8.txt:      UTF-8 Unicode text, with no line terminators

While the Java icu4j reports the utf16.txt file as ISO-8859-1.

Reproducible: Always

Steps to Reproduce:
Create a file with non-ASCII chars, choose save as and select the UTF-16 encoding in the save-as dialog.

Actual Results:  
The file is not saved as UTF-16.

Expected Results:  
A files saved as UTF-16.

OS: Linux (x86_64) release 2.6.35-22-generic
Compiler: cc
Comment 1 Christoph Cullmann 2011-06-24 22:45:04 UTC
Git commit 4d26a42c82d609912ae1dc5426b568e138764d8d by Christoph Cullmann.
Committed on 25/06/2011 at 00:44.
Pushed by cullmann into branch 'master'.

default to save BOM for UTF-16/32
fix used MIB numbers
BUG: 256053

M  +14   -2    part/buffer/katetextbuffer.cpp     
M  +2    -1    part/buffer/katetextbuffer.h     
M  +2    -2    part/buffer/katetextloader.h     

http://commits.kde.org/kate/4d26a42c82d609912ae1dc5426b568e138764d8d