Print Thread
DB Object - Save As adds 3 bytes to begining of file
#43188 01/23/12 04:31 PM
Joined: Nov 2011
Posts: 5
US, IL
K
KenW Offline OP
Member
OP Offline
Member
K
Joined: Nov 2011
Posts: 5
US, IL
PSD Version 9.0.4.1644
When I edit a database object then do a "Save As", the saved file always has these 3 bytes at the beginning of the file: ef bb bf.
Is there any way to prevent this??
I have to edit every file before I can load into our version control system and this just adds additional work.

Thanks for any help you can provide on this issue.
PC OS is Windows 7 SP1.

Re: DB Object - Save As adds 3 bytes to begining of file
KenW #43189 01/24/12 08:01 AM
Joined: Jul 2004
Posts: 24
Germany
H
Member
Offline
Member
H
Joined: Jul 2004
Posts: 24
Germany
This is perhaps BOM to sign file content as unicode.
Don't know what triggers PLSD to do that. Maybe unicode charcters in database object scripts?!
Anyway, what vcs / editor are You using? VCS shoouldn't care about that and "modern" editor same.


regards
Re: DB Object - Save As adds 3 bytes to begining of file
herzig #43193 01/24/12 10:46 AM
Joined: Aug 1999
Posts: 22,220
Member
Offline
Member
Joined: Aug 1999
Posts: 22,220
This is indeed the BOM marker for Unicode. This will happen if your source contains Unicode characters that are not included in your Windows character set. These characters would obviously be converted incorrectly.




Marco Kalter
Allround Automations
Re: DB Object - Save As adds 3 bytes to begining of file
Marco Kalter #43197 01/24/12 11:54 AM
Joined: Mar 2008
Posts: 29
Oslo, Norway
S
Member
Offline
Member
S
Joined: Mar 2008
Posts: 29
Oslo, Norway
Marco, is there any way to disable the BOM? The BOM can be a big problem for SQL*Plus scripts when executed in Linux.


Regards
Stian
Re: DB Object - Save As adds 3 bytes to begining of file
Marco Kalter #43199 01/24/12 05:16 PM
Joined: Nov 2011
Posts: 5
US, IL
K
KenW Offline OP
Member
OP Offline
Member
K
Joined: Nov 2011
Posts: 5
US, IL
Today I noticed that I get the same characters at beginning of "Export Query Results" to csv.
Is there something in Preferences that would do this?

I had to reinstall PSD when our support group upgraded my pc from XP to Windows 7 and I did not have a copy of the preferences file saved from XP so I had to recreate my Preferences from what I could remember (I'm sure I missed some).
I never had this issue running the same version of PSD on XP, only after changing to Windows 7.

Since it seems that all "saving" is putting in these characters I am beginning to believe that there may be some setting in the Preferences that I have different than when I was on XP.

Guidance on where to look would be appreciated.
Thanks!!

I found 2 places in Preferences that seem to have cleared up the issue:
Oracle - Options - "Unicode enables"; was checked, I unchecked.
Files - Format - "Encoding"; was "Always use UTF8", changed to "Autodetect".

Restarted PSD, Exported query result and view package body and Saved As - neither saved files had the 3 characters at the begining.

Regards.

Last edited by KenW; 01/24/12 05:37 PM.
Re: DB Object - Save As adds 3 bytes to begining of file
KenW #43203 01/25/12 09:24 AM
Joined: Mar 2008
Posts: 29
Oslo, Norway
S
Member
Offline
Member
S
Joined: Mar 2008
Posts: 29
Oslo, Norway
I believe the autodetect only saves a file as UTF8 when there are characters outside US ASCII (or windows default) character set.

As long as you only use US characters files will not be saved as UTF8.

In other countries this is a bigger problem as they often use accented or other special characters which needs UTF8.


Regards
Stian

Moderated by  support 

Link Copied to Clipboard
Powered by UBB.threads™ PHP Forum Software 7.7.4
(Release build 20200307)
Responsive Width:

PHP: 7.1.33 Page Time: 0.077s Queries: 14 (0.029s) Memory: 2.5232 MB (Peak: 3.0428 MB) Data Comp: Off Server Time: 2024-05-18 22:37:35 UTC
Valid HTML 5 and Valid CSS