Code Monkey home page Code Monkey logo

Comments (8)

true-hb avatar true-hb commented on June 2, 2024

I've got a similar problem.

I use just a simple Script for testing, stored with win-1252 encoding:

COLUMN parameter FORMAT A20
COLUMN value FORMAT A20
SELECT * FROM V$NLS_PARAMETERS
WHERE parameter IN ('NLS_LANGUAGE', 'NLS_TERRITORY', 'NLS_CHARACTERSET');
SELECT USERENV('LANGUAGE') FROM dual;
SELECT 'ÄÖÜ-äöüß-€' AS umlaute FROM DUAL;

grafik

In oradewrc.json I have
"source.encoding": "win1252",

and in settings.json:

	"files.encoding": "windows1252",
	"terminal.integrated.shell.windows": "C:\\Windows\\System32\\cmd.exe",
	"terminal.integrated.shellArgs.windows": "/k chcp 1252",
	"oradew.envVariables": {
		"NLS_LANG": "GERMAN_GERMANY.WE8MSWIN1252"
	}

When I Show NLS_LANG in Dos-Shell:

Z:\>echo %NLS_LANG%
AMERICAN_AMERICA.we8mswin1252

When I use sqlplus.exe in the vscode-Terminal, everything is fine:
grafik

What can I do?

from oradew-vscode.

mickeypearce avatar mickeypearce commented on June 2, 2024

Have you tried also setting chcp in the intermediate sql.bat file (cliExecutable) setting?

from oradew-vscode.

Danieleeee avatar Danieleeee commented on June 2, 2024

I also get the same error (????) and I use the following file.bat

chcp 1252 
set NLS_LANG=.WE8MSWIN1252
sqlplus %*

the file.bat solves the problems of special characters when saving objects in the DB, but not when getting information from the DB.
I think it is related to the problem that I reported above concerning the import of objects from DB.
If the script (file.sql) is written with UTF8 encoding there are no problems. If I use Windows1252, it doesn't work.

from oradew-vscode.

Danieleeee avatar Danieleeee commented on June 2, 2024

It probably depends on how the task to launch the command is configured.
Take a look here:
Changing the encoding for a task output

from oradew-vscode.

mickeypearce avatar mickeypearce commented on June 2, 2024

The oradew task which subsequently runs sql (cli) process is executed through processExecution:

new vscode.ProcessExecution(

I believe that is the reason why shellArgs don't do the trick here and I am not sure if it is possible to pass chcp to terminal used in processExecution and how.

Maybe changing the default code page of the terminal could help:
https://superuser.com/questions/269818/change-default-code-page-of-windows-console-to-utf-8

from oradew-vscode.

mickeypearce avatar mickeypearce commented on June 2, 2024

Importing with "import selected object" is a different story as it save file on disk (not related to chcp). It should work with correctly setting property ("source.encoding": "win1252").

from oradew-vscode.

Danieleeee avatar Danieleeee commented on June 2, 2024

I do not recommend you to change the code page of the machine, it may stop the Windows operating system.
Thanks @mickeypearce, I hope that at least it works out for the objects imported from the DB.

from oradew-vscode.

Danieleeee avatar Danieleeee commented on June 2, 2024

@mickeypearce this is my oradewrc.json:

{
  "compile.warnings": "NONE",
  "compile.force": true,
  "compile.stageFile": false,
  "source.input": ["./Database/**/*.sql"],
  "source.encoding": "win1250",
  "source.pattern": {
    "packageSpec": "./Database/{schema-name}/STOREDS/PKSPEC/{object-name}_h.sql",
    "packageBody": "./Database/{schema-name}/STOREDS/PKBODY/{object-name}_b.sql",
    "trigger": "./Database/{schema-name}/TRIGGERS/{object-name}.sql",
    "typeSpec": "./Database/{schema-name}/TYPES/{object-name}.sql",
    "typeBody": "./Database/{schema-name}/TYPE_BODIES/{object-name}.sql",
    "view": "./Database/{schema-name}/VIEWS/{object-name}.sql",
    "function": "./Database/{schema-name}/STOREDS/FUNC/{object-name}.sql",
    "procedure": "./Database/{schema-name}/STOREDS/PROC/{object-name}.sql",
    "table": "./Database/{schema-name}/TABS/{object-name}_tab.sql",
    "synonym": "./Database/{schema-name}/SYNONYMS/{object-name}.sql",
    "apex": "./Database/{schema-name}/APEX/{object-name}.sql"
  },
  "import.ease": true,
  "import.getDdlFunction": "siu.utl_generate_oradew.getddl",
  "package.input": ["./Database/**/*.sql", "./scripts/**/*.sql"],
  "package.exclude": ["./scripts/**/+(file|run|test)*.sql"],
  "package.output": "./pubblicazione/{schema-name}.sql",
  "package.encoding": "win1250",
  "package.templating": false,
  "test.input": ["./test/**/*.test.sql"],
  "version.number": "0.0.1",
  "version.description": "Gestione DB",
  "version.releaseDate": "2021-01-01"
}

putting "source.encoding": "win1252" the problem is solved. my mistake

from oradew-vscode.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.