Toad World® Forums

Sending file to a new session changes it's encoding...


#1

For a while I was wondering which tool keeps changing the encoding of my files and it appears it is SQLnav :slight_smile:

Test case:

Create a file in UTF8 without BOM encoding:

4101.ScreenShot020.jpeg

Then open it in SQLnav in one session and then choose to send it to a new session:

8715.ScreenShot021.jpeg

When the files is transferred to the new session just press CTRL+S.

8715.ScreenShot022.jpeg

Then go an check out the encoding of the file and it has changed. Why? :slight_smile:

8715.ScreenShot023.jpeg


#2

Hi Martin,

The reason for that is because Code Editor 's default encoding is “ANSI”, so the encoding has been changed when loaded new scripts into Code Editor.

Besides, you can still keep the encoding by "Save File As " (key shortcuts: Alt+F+A) , and then select the needed encoding in "Save As " dialog.

I hope so the above can help you, if have any question just let we know please, thanks.

Regards,

Alan


#3

Ok, I get that Code Editor has its default encoding but that should apply to a new editor (CTRL+M).

This scenario happens on a daily basis with me. I open a script in UTF8 (of course sometimes I use ANSI) encoding and then I want to execute it on one database, make some notes/changes in the file and after a while execute it on another environment, change something in the file, save, then maybe go back to the first environment or maybe go to another and so on.

It shouldn’t change the encoding of the file - I am operating with the same file all the time. I mean “Save File As” is something else. I am using the same file. I consider this a bug because changing automatically a files encoding makes no sense :slight_smile: Don’t you think?

The “Send to New Session” is a great option - I like it very much. Could you consider fixing this thing the way I suggest?


#4

Hi Martin,

Thanks for your suggestions, I have created a new enhancement(SQLNAV-1959:File’s encoding has been changed when send it to new session) for you.

Regards,

Alanvi


#5

Martin, SQLNAV-1959 is fixed in beta build 4104.