This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Summary: | Display / encoding problems with files of type text/x-sql | ||
---|---|---|---|
Product: | db | Reporter: | malm <malm> |
Component: | SQL Editor | Assignee: | Jiri Skrivanek <jskrivanek> |
Status: | RESOLVED FIXED | ||
Severity: | blocker | ||
Priority: | P3 | ||
Version: | 6.x | ||
Hardware: | Other | ||
OS: | Linux | ||
Issue Type: | DEFECT | Exception Reporter: | |
Attachments: |
Screenshot of garbled display
Request SQL file in UTF-16 encoding as created by SQL Server Mgmt Studio |
Description
malm
2009-01-12 03:32:25 UTC
Created attachment 75677 [details]
Screenshot of garbled display
May be I was a bit quick with this issue as it is not related to the file extension. Further investigation showed that the problem is related to MS SQL Server Management Studio using UTF-16 encoding by default (can't seem to change the default) when saving files and NetBeans appears not to be able to understand that encoding. Looking at the file in a binary editor it appears to correctly start with the Unicode BOM so the format should be detectable. Passing to editor - please evaluate. Thanks. In general file encoding in Netbeans is set for a project and you can change it in Properties -> Sources -> Encoding. The encoding will apply for all files in the project. However, some files can specify their own encoding independently on the project (eg. AFAIK JSP, xml files do so). I think this is controlled by FileEncodingQuery implementations provided by editor support modules for those languages. Therefore I'm passing this on to sql editor folks. As a quick solution I would suggest to change the encoding of the project where you have your SQL files to UTF-16. Reassigned to new owner. Could you attach sample UTF-16 file? Created attachment 87615 [details]
Request SQL file in UTF-16 encoding as created by SQL Server Mgmt Studio
Added SQLFileEncodingQueryImpl which detects UTF-16 encoding. core-main #f26a5195d9d0 Integrated into 'main-golden', will be available in build *200909181401* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/f26a5195d9d0 User: Jiri Skrivanek <jskrivanek@netbeans.org> Log: #156585 - Detect UTF-16 encoding for SQL files. |