|
Home > Archive > Microsoft SQL Server forum > January 2006 > isql / osql / Windows XP / disable "Automatic ANSI to OEM conversion"
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
isql / osql / Windows XP / disable "Automatic ANSI to OEM conversion"
|
|
| Philip Bondi 2006-01-13, 8:23 pm |
| Hello to all SQL Server junkies who work with non-English characters:
For people running scripts from the command line using ANSI files with
special characters, it is very important to use isql and disable
"Automatic ANSI to OEM conversion":
- This only affects isql from the command line, and no gui
applications
- http://support.microsoft.com/?scid=kb;EN-US;153449
- Start the "Client Network Utility"
C:\WINDOWS\system32\
cliconfg.exe
- Select the DB-Library Tab
- Deselect "Automatic ANSI to OEM conversion"
- Click OK or Apply
Or inject this registry entry:
& #91;HKEY_LOCAL_MACHI
NE\SOFTWARE\Microsof
t\MSSQLServer\Client
\DB-Lib]
"AutoAnsiToOem"="OFF"
Here are some useful lines from a batch script to query the current
value of the registry and reset if necessary. This is tested on
Windows XP. It will query the registry, throw away the first three
lines of output, and return the value of the third field on the fourth
line. Delims lists one tab character and one space character. Type the
following all on one line:
@FOR /F "SKIP=3 TOKENS=3 DELIMS= " %%A IN ('REG QUERY
HKLM\SOFTWARE\Micros
oft\MSSQLServer\Clie
nt\DB-Lib /v AutoAnsiToOem') DO
@SET AUTOANSITOOEM=%%A
Type the "reg add" line all on one line:
@IF /i "%AUTOANSITOOEM%" EQU "ON" (
@ECHO
********************
********************
********************
************
@ECHO ****
@ECHO **** We need to disable "Automatic ANSI to OEM conversion"
@ECHO **** Please see
http://support.microsoft.com/?scid=kb;EN-US;153449
@ECHO **** This only affects isql from the command line
@ECHO ****
@ECHO
********************
********************
********************
************
@REM
REG ADD HKLM\SOFTWARE\Micros
oft\MSSQLServer\Clie
nt\DB-Lib /v
AutoAnsiToOem /t REG_SZ /d OFF
)
Alternatively, you must use Unicode script files and osql.
PS: Thank you to Erland Sommarskog for http://www.sommarskog.se and Rob
van der Woude for http://www.robvanderwoude.com
| |
| Philip Bondi 2006-01-19, 3:24 am |
| Within the FOR command use SKIP=2 on Windows Server 2003
Philip Bondi wrote:
> Hello to all SQL Server junkies who work with non-English characters:
>
> For people running scripts from the command line using ANSI files with
> special characters, it is very important to use isql and disable
> "Automatic ANSI to OEM conversion":
> - This only affects isql from the command line, and no gui
> applications
> - http://support.microsoft.com/?scid=kb;EN-US;153449
> - Start the "Client Network Utility"
> C:\WINDOWS\system32\
cliconfg.exe
> - Select the DB-Library Tab
> - Deselect "Automatic ANSI to OEM conversion"
> - Click OK or Apply
>
> Or inject this registry entry:
> & #91;HKEY_LOCAL_MACHI
NE\SOFTWARE\Microsof
t\MSSQLServer\Client
\DB-Lib]
> "AutoAnsiToOem"="OFF"
>
> Here are some useful lines from a batch script to query the current
> value of the registry and reset if necessary. This is tested on
> Windows XP. It will query the registry, throw away the first three
> lines of output, and return the value of the third field on the fourth
> line. Delims lists one tab character and one space character. Type the
> following all on one line:
>
> @FOR /F "SKIP=3 TOKENS=3 DELIMS= " %%A IN ('REG QUERY
> HKLM\SOFTWARE\Micros
oft\MSSQLServer\Clie
nt\DB-Lib /v AutoAnsiToOem') DO
> @SET AUTOANSITOOEM=%%A
>
> Type the "reg add" line all on one line:
>
> @IF /i "%AUTOANSITOOEM%" EQU "ON" (
> @ECHO
> ********************
********************
********************
************
> @ECHO ****
> @ECHO **** We need to disable "Automatic ANSI to OEM conversion"
> @ECHO **** Please see
> http://support.microsoft.com/?scid=kb;EN-US;153449
> @ECHO **** This only affects isql from the command line
> @ECHO ****
> @ECHO
> ********************
********************
********************
************
> @REM
> REG ADD HKLM\SOFTWARE\Micros
oft\MSSQLServer\Clie
nt\DB-Lib /v
> AutoAnsiToOem /t REG_SZ /d OFF
> )
>
> Alternatively, you must use Unicode script files and osql.
>
> PS: Thank you to Erland Sommarskog for http://www.sommarskog.se and Rob
> van der Woude for http://www.robvanderwoude.com
|
|
|
|
|