sudr / dbdeploy

Automatically exported from code.google.com/p/dbdeploy
0 stars 0 forks source link

dbdeploy probably needs to worry about character encoding #21

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
dbdeploy currently opens the script files without specifying a character
encoding, meaning it uses the platform default encoding.

Good practice suggests that it should be possible to explicitly specify what
character encoding is used to read change script files.

Original issue reported on code.google.com by gtack...@googlemail.com on 4 May 2009 at 2:51

GoogleCodeExporter commented 9 years ago

Original comment by gtack...@googlemail.com on 18 Oct 2009 at 9:06

GoogleCodeExporter commented 9 years ago
Hello,

Here is a patch which adds the "encoding" property to the ant task. It does not
contain any documentation or new test-cases.
If you don't enter the "encoding" property, db-deploy acts exactly as before. 
If you
specify a value, all file reads and writes are performed with it.

As a note,
ScriptGenerationTest.generateConsolidatedChangesScriptForAllDatabasesAndCompareA
gainstTemplate()
fails both with the patch and with the latest revision from the repository 
(r135).
Otherwise I have tried it with encoding="UTF-8" and without specifying 
encoding, but
not with anything else.

Kiril Raychev

Original comment by kiril.ra...@gmail.com on 23 Apr 2010 at 10:12

Attachments:

GoogleCodeExporter commented 9 years ago
I hope this is the place for this comment,

I had a simple script:
ALTER TABLE dbo.DSP_ARTIST_CONTROLS ADD B_ADVERT_ENABLED bit NOT NULL 
CONSTRAINT DF_DSP_ARTIST_CONTROLS_B_ADVERT_ENABLED DEFAULT 0

when this executed I got an error:
"java.sql.SQLException: Incorrect syntax near 'T'."

when inspecting the encoded in UCS-2 Big Endian - saving as ansi fixed this

Original comment by jscott...@gmail.com on 3 Aug 2010 at 2:42

GoogleCodeExporter commented 9 years ago
Why dont you add this patch to SVN? I had to patch it myself, it works fine for 
me.

Original comment by Martin.C...@gmail.com on 24 Oct 2010 at 10:42

GoogleCodeExporter commented 9 years ago
Implemented in r150 with code inspied by Kiril's patch (thanks!).

Ant task, command line, and maven plugin now support endcoding= parameter. Note 
that I have defaulted this to UTF-8, which is *breaking change* compared to 
previous dbdeploy releases which defaulted to platform encoding.

Needs documentation update.

Original comment by gtack...@googlemail.com on 14 Mar 2011 at 5:05

GoogleCodeExporter commented 9 years ago

Original comment by gtack...@googlemail.com on 15 Mar 2011 at 4:24