goldmansachs/obevo

NEWREVENG -mode SCHEMA -dbType oracle : UTF-8 character issue

snurbles opened this issue · 4 comments

Expected Behavior

Chinese characters written to UTF-8 File correctly.

Actual Behavior

Chinese characters are transformed incorrectly.

Obevo Version where this issue was observed

7.0.2

Steps to reproduce the behaviour

I have an Oracle 12c DB that contains stored procedures and table data with simplified Chinese characters.

SELECT * FROM NLS_DATABASE_PARAMETERS WHERE PARAMETER LIKE '%CHARACTERSET';
on the DB returns:

NLS_NCHAR_CHARACTERSET AL16UTF16
NLS_CHARACTERSET AL32UTF8

I'm running Obevo 7.0.2 on Windows 7 64 bit. I've dropped ojdbc7.jar and orai18n.jar into %OBEVO_HOME%\lib\ directory.

I've created a system environment variable called:
JAVA_TOOL_OPTIONS with value set to: -Dfile.encoding="UTF-8"

If I create a sample SP in SQL Developer, you can see the Chinese characters correctly.

I'm using the command:
%OBEVO_HOME%\bin\deploy.bat NEWREVENG -mode SCHEMA -dbType oracle -jdbcUrl jdbc:oracle:thin:@localhost:1521/xe -dbSchema DBUSER -username DBUSER -password password123 -outputPath %KATA_HOME%/localDBTest

When Obevo scripts out the SP, it creates a UTF-8 file, but still does some kind of conversion on the encoding.

Please see screenshots attached.

Sample SP is:
create or replace PROCEDURE character_test AS
BEGIN
dbms_output.put_line('Hello world'); --目标表名
END character_test;

Output in script file is:
CREATE OR REPLACE EDITIONABLE PROCEDURE CHARACTER_TEST AS
BEGIN
dbms_output.put_line('Hello world'); --��h
END character_test
GO

Thanks
character_test sp in sql developer
character_test sp output

Thanks for the detailed info to reproduce the use case, it is very helpful.
I will take a look and provide an update later this week

Thanks for the super quick update!

Will check it out and let you know.

Works perfect, thankyou!!