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.

Bug 110971 - I18N - sql file and encoding handling
Summary: I18N - sql file and encoding handling
Status: VERIFIED FIXED
Alias: None
Product: db
Classification: Unclassified
Component: SQL Editor (show other bugs)
Version: 6.x
Hardware: Sun All
: P3 blocker (vote)
Assignee: Andrei Badea
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-07-25 16:26 UTC by Ken Frank
Modified: 2007-12-04 14:25 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ken Frank 2007-07-25 16:26:53 UTC
from email with Andrei

>for nb6 there is the new project encoding property and certain
>> changes on how certain files handle encoding and how certain
>> files (jsp/html/xml) are seeded with encoding or charset value.
>> 
>> please ignore this question  if things mentioned below has been done or not 
>> needed to be done:
>> 
>> Does the db query or other functionality need to query for and use the
>> project or global encoding property ?  or other parts of db
>> functionality ?
>> (I realize user does not need to be in project to use db)
>> 
>> (( that is, in prev release, the encoding of the locale the user is in
>> was used as the encoding to use, but thats not the case now)
>> 
>> also, soa allows sql project with .sql file created - I don't know if this
>> filetype needs have its own file encoding or if can use that of project
>> or global.


If there is a way for the user to create a SQL file, we should probably 
support encodings correctly. Currently the SQL editor only supports 
UTF-8 with BOM and the default locale encoding. Could you please file an 
issue for it?
Comment 1 Andrei Badea 2007-07-25 18:47:02 UTC
Done, will commit tomorrow.
Comment 2 Ken Frank 2007-07-25 18:58:49 UTC
what's the "rule" on this - since I think .sql might not be related to a given project sometimes,
does it use the global encoding value for its view of encoding or that of locale user is in ?

or if part of like soa sql project, does it use encoding of that project ?

(I want to understand some scenarios for testing this)

ken.frank@sun.com
Comment 3 Andrei Badea 2007-07-25 21:09:23 UTC
Frankly, I don't know, I'll check tomorrow. What I did was:

- make sure that SQL files in projects use the project encoding

- make sure that the "console" SQL files (e.g. from View Data in the DB Explorer) use UTF-8 (this is the current state,
I just reimplemented it using FileEncodingQuery)

I guess SQL files not owned by a project should use the same encoding other files do. I didn't do anything special there.
Comment 4 Andrei Badea 2007-07-26 14:22:43 UTC
The charset for SQL files not owned by a project is the default charset, which is based on the default locale.
Comment 5 Andrei Badea 2007-07-26 14:23:16 UTC
Fixed.

Checking in core/nbproject/project.xml;
/cvs/db/core/nbproject/project.xml,v  <--  project.xml
new revision: 1.8; previous revision: 1.7
done
Checking in core/src/org/netbeans/modules/db/sql/loader/SQLDataObject.java;
/cvs/db/core/src/org/netbeans/modules/db/sql/loader/SQLDataObject.java,v  <--  SQLDataObject.java
new revision: 1.5; previous revision: 1.4
done
Checking in core/src/org/netbeans/modules/db/sql/loader/SQLEditorSupport.java;
/cvs/db/core/src/org/netbeans/modules/db/sql/loader/SQLEditorSupport.java,v  <--  SQLEditorSupport.java
new revision: 1.19; previous revision: 1.18
done
Checking in sqleditor/src/org/netbeans/modules/db/sql/editor/SQLEditorProviderImpl.java;
/cvs/db/sqleditor/src/org/netbeans/modules/db/sql/editor/SQLEditorProviderImpl.java,v  <--  SQLEditorProviderImpl.java
new revision: 1.8; previous revision: 1.7
done
Comment 6 kaa 2007-12-04 14:25:51 UTC
verified:
sql files shows mbyte ok. Checked with utf-8/win-31j project encoding