Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 327175 - BOM ignored when opening SQL-File
Summary: BOM ignored when opening SQL-File
Status: NEW
Alias: None
Product: Data Tools
Classification: Tools
Component: DataTools (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 minor (vote)
Target Milestone: future   Edit
Assignee: dtp.sqldevtools-inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-10-07 01:19 EDT by Tomka Kuje CLA
Modified: 2011-02-18 20:36 EST (History)
1 user (show)

See Also:


Attachments
SQL-Script, encoded in UTF16 (LE). The BOM "FFFE" is set. (162 bytes, application/octet-stream)
2010-10-07 01:24 EDT, Tomka Kuje CLA
no flags Details
Text-file (binary identical to the SQL-Script), encoded in UTF16 (LE). The BOM "FFFE" is set. (158 bytes, application/octet-stream)
2010-10-07 01:25 EDT, Tomka Kuje CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tomka Kuje CLA 2010-10-07 01:19:37 EDT
Build Identifier: 20100917-0705

If you doubleclick a *.sql-file (that is encoded in UTF-16 (LE) and has the correct BOM set) in the Navigator-view, the SQL-Editor opens and shows the file corrupted (BOM is displayed as first characters, not the default font is used and a space is displayed between each character).
If you rightclick on the same *.sql-file, the properties-dialog shows as text file encoding "Default (inherited from container: Cp1252).

If you rename the same file to *.txt, the text-editor shows the file correctly and the properties-dialog shows as text file encoding "Byte Order Mark is UTF-16 Little Endian (BOM)".

You do not have this problems with UTF-8-encoded *.sql-Files. They are displayed correctly and the file encoding shows "Byte Order Mark is UTF-8 (BOM)".
The BOM of a UTF-8-encoded file is also recognized 

Reproducible: Always

Steps to Reproduce:
1. Create a new project (does not matter what type, I tried it with "Java-Project" and "General - Project").
2. Copy the attached files utf16WithBom.sql and utf16WithBom.txt to the project.
3. Doubleclick the files (which are binaray equal).
4. Rightclick on the files and select "properties" to display the "text file encoding".
5. Close the *.sql-file.
6. Rename the *.sql-file to *.txt.
7. repeat steps 3 and 4.
Comment 1 Tomka Kuje CLA 2010-10-07 01:24:55 EDT
Created attachment 180385 [details]
SQL-Script, encoded in UTF16 (LE). The BOM "FFFE" is set.

Content Type is set to "binary" to prevent Webserver from changing content type.
Comment 2 Tomka Kuje CLA 2010-10-07 01:25:48 EDT
Created attachment 180386 [details]
Text-file (binary identical to the SQL-Script), encoded in UTF16 (LE). The BOM "FFFE" is set.

Content Type is set to "binary" to prevent Webserver from changing content type.
Comment 3 Tomka Kuje CLA 2010-10-07 01:27:18 EDT
Importance is set to "minor" because you can manually set the file-encoding in the properties-dialog for each UTF-16-SQL-File.