Changing charset on IDS 11
Posted in 2011
A user on Windows wanted an Informix 11 database created in UTF-8, so he edited dbaccessdemo.cmd to force DB_LOCALE/CLIENT_LOCALE/SERVER_LOCALE/DBLANG to EN_US.UTF8. The database itself showed the expected UTF-8 locale (en_EN.57327) when queried via WinSQL, but connecting with Server Studio R8 produced locale/charset errors. Suggestions were to check the locale settings in the script and to match the DB locale in Server Studio's connection properties (Database tab, Advanced); trying both EN_US.UTF8 and en_EN.57327 there did not help. The poster concluded the fault lay with the Server Studio client: using Visual Studio instead gave a working connection with correct codepage, so no fix for Server Studio is recorded.
Auto-generated by DrWatson from the posts below — may be imperfect; read the full thread.
Topics: Server Administration, Internationalization & Character Sets
Hi,
I have problem with changing charset different then standard,
I need to set en_EN.UTF8
So, I modify the script called dbaccessdemo.cmd
add/modify what i done:
call %INFORMIXDIR%\\\\%INFORMIXSERVER%.cmd
if /i "%DB_LOCALE%notset" == "notset" set DB_LOCALE=EN_US.UTF8
if /i "%DB_LOCALE%" == "EN_US.C" set DB_LOCALE=EN_US.UTF8
if /i "%DB_LOCALE%" == "EN_US.POSIX" set DB_LOCALE=EN_US.UTF8
if /i "%DB_LOCALE%" == "EN_US.Latin-1" set DB_LOCALE=EN_US.UTF8
if /i "%DB_LOCALE%" == "EN_US.819" set DB_LOCALE=EN_US.UTF8
if /i not "%DB_LOCALE%" == "EN_US.8859-1" echo Setting DB_LOCALE to EN_US.UTF8
set CLIENT_LOCALE=EN_US.UTF8
set DB_LOCALE=EN_US.UTF8set SERVER_LOCALE=EN_US.UTF8
set DBLANG=EN_US.UTF8
Now with winsql i connect to my new db and procede query:
select tabname, site from systables where tabname like ' GL%';
Im getting:
GL_COLLATE en_EN.57327
GL_CTYPE en_US.57327
Change`s was made with succes, so what is wrong that when I try to connect
with other program(server studio R8) I`m getting error like this:
http://imageshack.us/photo/my-images/845/serverstudio.jpg/
Of course I read a lot about this error, but... Can`t figure out what to do to
make this work together...
Piotr
You might want to check the dbaccessdemo.cmd script to see if it
sets the LOCALE environment variables explicitly. I believe it does.
John F. Miller III
STSM, Embedability Architect
miller3@us.ibm.com
503-578-5645
IBM Informix Dynamic Server (IDS)
ids-bounces@iiug.org wrote on 06/01/2011 11:51:32 PM:
> From:
>
> "NONE PIOTR" <wachman54@tlen.pl>
>
> To:
>
> ids@iiug.org
>
> Date:
>
> 06/01/2011 11:53 PM
>
> Subject:
>
> Changing charset on IDS 11 [23903]
>
> Sent by:
>
> ids-bounces@iiug.org
>
> Hi,
> I have problem with changing charset different then standard,
> I need to set en_EN.UTF8
> So, I modify the script called dbaccessdemo.cmd
>
> add/modify what i done:
> call %INFORMIXDIR%\\\\%INFORMIXSERVER%.cmd
> if /i "%DB_LOCALE%notset" == "notset" set DB_LOCALE=EN_US.UTF8
> if /i "%DB_LOCALE%" == "EN_US.C" set DB_LOCALE=EN_US.UTF8
> if /i "%DB_LOCALE%" == "EN_US.POSIX" set DB_LOCALE=EN_US.UTF8
> if /i "%DB_LOCALE%" == "EN_US.Latin-1" set DB_LOCALE=EN_US.UTF8
> if /i "%DB_LOCALE%" == "EN_US.819" set DB_LOCALE=EN_US.UTF8
> if /i not "%DB_LOCALE%" == "EN_US.8859-1" echo Setting DB_LOCALE to
> EN_US.UTF8
>
> set CLIENT_LOCALE=EN_US.UTF8
> set DB_LOCALE=EN_US.UTF8> set SERVER_LOCALE=EN_US.UTF8
> set DBLANG=EN_US.UTF8
>
> Now with winsql i connect to my new db and procede query:
> select tabname, site from systables where tabname like ' GL%';>
> Im getting:
> GL_COLLATE en_EN.57327
> GL_CTYPE en_US.57327
>
> Change`s was made with succes, so what is wrong that when I try to
connect
> with other program(server studio R8) I`m getting error like this:
> http://imageshack.us/photo/my-images/845/serverstudio.jpg/
>
> Of course I read a lot about this error, but... Can`t figure out
> what to do to
> make this work together...
>
> Piotr
>
>
>
*******************************************************************************
> Forum Note: Use "Reply" to post a response in the discussion forum.
>
honestly im not sure what u got on mind...
I paste whole script, hope this won`t clutter this topic
@echo off
rem **************************************************************************/
rem * */
rem * Licensed Materials - Property of IBM */
rem * */
rem * "Restricted Materials of IBM" */
rem * */
rem * IBM Informix Dynamic Server */
rem * Copyright IBM Corporation 2007 All rights reserved. */
rem * */
rem **************************************************************************/
if %1test==/?test goto usage
if %1test==--test goto usage
if %1test==-?test goto usage
if %1test==-helptest goto usage
if "%INFORMIXDIR%notset" == "notset" goto error_infxdir
if "%INFORMIXSERVER%notset" == "notset" goto error_infxserver
if not exist %INFORMIXDIR%\\\\demo\\\\dbaccess\\\\demo_ids goto error_demodir
set CLIENT_LOCALE_SAV=%CLIENT_LOCALE%
set GL_DATE_SAV=%GL_DATE%
set DBMONEY_SAV=%DBMONEY%
set CREATE_SAV=%CREATE%
set DB_SAV=%DB%
set IN_SAV=%IN%
set DBSPACE_SAV=%DBSPACE%
set WLOG_SAV=%WLOG%
set GL_DATE=%%m/%%d/%%Y
set DBMONEY=$.
set CREATE=CREATE DATABASE
set DB=stores_demo4
set IN=
set DBSPACE=
set WLOG=
REM evaluate command line arguments
if %1test==test goto startdb
if %1test==-logtest goto log1
if %1test==-dbspacetest goto dbspace1
set DB=%1
goto test2
:log1
set WLOG=WITH LOG
goto test2
:dbspace1
set IN=in
set DBSPACE=%2
:test2
if %2test==test goto startdb
if %2test==-logtest goto log2
if %2test==-dbspacetest goto dbspace2
if NOT %1test==-dbspacetest SET DB=%2
goto test3
:log2
set WLOG=WITH LOG
goto test3
:dbspace2
set IN=in
set DBSPACE=%3
:test3
if %3test==test goto startdb
if %3test==-logtest goto log3
if %3test==-dbspacetest goto dbspace3
if NOT %2test==-dbspacetest SET DB=%3
goto test4
:log3
set WLOG=WITH LOG
goto test4
:dbspace3
set IN=in
set DBSPACE=%4
:test4
if %4test==test goto startdb
if %4test==-logtest goto log4
if NOT %3test==-dbspacetest SET DB=%4
goto startdb:
:log4
set WLOG=WITH LOG
:startdb
REM cd %INFORMIXDIR%\\\\demo\\\\dbaccess\\\\demo_ids
call %INFORMIXDIR%\\\\%INFORMIXSERVER%.cmd
if /i "%DB_LOCALE%notset" == "notset" set DB_LOCALE=EN_US.UTF8
if /i "%DB_LOCALE%" == "EN_US.C" set DB_LOCALE=EN_US.UTF8
if /i "%DB_LOCALE%" == "EN_US.POSIX" set DB_LOCALE=EN_US.UTF8
if /i "%DB_LOCALE%" == "EN_US.Latin-1" set DB_LOCALE=EN_US.UTF8
if /i "%DB_LOCALE%" == "EN_US.819" set DB_LOCALE=EN_US.UTF8
if /i not "%DB_LOCALE%" == "EN_US.8859-1" echo Setting DB_LOCALE to EN_US.UTF8
set CLIENT_LOCALE=EN_US.UTF8
set DB_LOCALE=EN_US.UTF8set SERVER_LOCALE=EN_US.UTF8
set DBLANG=EN_US.UTF8
pushd %INFORMIXDIR%\\\\demo\\\\dbaccess\\\\demo_ids
REM drop the existing %DB% database
echo Dropping existing %DB% database...
echo DROP DATABASE %DB% | dbaccess -
REM create the database
echo Creating %DB% database...
echo %CREATE% %DB% %IN% %DBSPACE% %WLOG% | dbaccess -
if not errorlevel 0 goto error_cdb
REM create external table
echo preparing external table command...
echo create external table ext_customer sameas customer >
%INFORMIXDIR%\\\\demo\\\\dbaccess\\\\demo_ids\\\\c_ext_table.sql
echo using (datafiles
("disk:%INFORMIXDIR%\\\\demo\\\\dbaccess\\\\demo_ids\\\\ext_customer.unl"), >>
%INFORMIXDIR%\\\\demo\\\\dbaccess\\\\demo_ids\\\\c_ext_table.sql
echo numrows 3 >> %INFORMIXDIR%\\\\demo\\\\dbaccess\\\\demo_ids\\\\c_ext_table.sql
echo ); >> %INFORMIXDIR%\\\\demo\\\\dbaccess\\\\demo_ids\\\\c_ext_table.sql
REM create the tables
echo Creating tables...
dbaccess %DB% %INFORMIXDIR%\\\\demo\\\\dbaccess\\\\demo_ids\\\\c_tables.sql
if not errorlevel 0 goto error_ctables
REM create external table
echo Creating external table...
dbaccess %DB% %INFORMIXDIR%\\\\demo\\\\dbaccess\\\\demo_ids\\\\c_ext_table.sql
if not errorlevel 0 goto error_ctables
REM load data
echo Loading data...
dbaccess %DB% %INFORMIXDIR%\\\\demo\\\\dbaccess\\\\demo_ids\\\\c_load.sql
if not errorlevel 0 goto error_load
goto SUCCESS
:usage
echo "Usage: dbaccessdemo [-log] [-dbspace <dbspace name>] [<database name>]"
goto end
:error_infxdir
echo INFORMIXDIR environment variable not set.
goto end
:error_infxserver
echo INFORMIXSERVER environment variable not set
goto end
:error_cdb
echo Database creation failed.
goto end
:error_ctables
echo Tables creation failed.
goto end
:error_load
echo Load data failed.
goto end
:error_demodir
echo Directory %INFORMIXDIR%\\\\demo\\\\dbaccess\\\\demo_ids not found.
goto end
:SUCCESS
echo The %DB% database created successfully.
echo The demo files can be found in %INFORMIXDIR%\\\\demo\\\\dbaccess\\\\demo_ids
:end
set GL_DATE=%GL_DATE_SAV%
set DBMONEY=%DBMONEY_SAV%
set CREATE=%CREATE_SAV%
set DB=%DB_SAV%
set IN=%IN_SAV%
set DBSPACE=%DBSPACE_SAV%
set WLOG=%WLOG_SAV%
set CLIENT_LOCALE=%CLIENT_LOCALE_SAV%
set GL_DATE_SAV=
set DBMONEY_SAV=
set CREATE_SAV=
set DB_SAV=
set IN_SAV=
set DBSPACE_SAV=
set WLOG_SAV=
set CLIENT_LOCALE_SAV=
echo.
popd
Check the properties on your Serverstudio connection, there is an option to
set the DB Locale property (inside the connection Properties, Tab "Database"
Button "Advanced". Both (Informix server DB and ServerStudio Connection) has
to match. Don´t remember if you have to use EN_US.UTF8 or en_EN.57327 Value.
Fiddled with it a year ago, but kept up with the old 8Bit settings...
Joerg Volz
-----------------------------------------------------------------------------
-----Original Message-----
From: ids-bounces@iiug.org [mailto:ids-bounces@iiug.org] On Behalf Of NONE
PIOTR
Sent: Thursday, June 02, 2011 9:01 AM
To: ids@iiug.org
Subject: Changing charset on IDS 11 [23903]
Hi,
I have problem with changing charset different then standard,
I need to set en_EN.UTF8
So, I modify the script called dbaccessdemo.cmd
add/modify what i done:
call %INFORMIXDIR%\\\\%INFORMIXSERVER%.cmd
if /i "%DB_LOCALE%notset" == "notset" set DB_LOCALE=EN_US.UTF8
if /i "%DB_LOCALE%" == "EN_US.C" set DB_LOCALE=EN_US.UTF8
if /i "%DB_LOCALE%" == "EN_US.POSIX" set DB_LOCALE=EN_US.UTF8
if /i "%DB_LOCALE%" == "EN_US.Latin-1" set DB_LOCALE=EN_US.UTF8
if /i "%DB_LOCALE%" == "EN_US.819" set DB_LOCALE=EN_US.UTF8
if /i not "%DB_LOCALE%" == "EN_US.8859-1" echo Setting DB_LOCALE to EN_US.UTF8
set CLIENT_LOCALE=EN_US.UTF8
set DB_LOCALE=EN_US.UTF8set SERVER_LOCALE=EN_US.UTF8
set DBLANG=EN_US.UTF8
Now with winsql i connect to my new db and procede query:
select tabname, site from systables where tabname like ' GL%';
Im getting:
GL_COLLATE en_EN.57327
GL_CTYPE en_US.57327
Change`s was made with succes, so what is wrong that when I try to connect
with other program(server studio R8) I`m getting error like this:
http://imageshack.us/photo/my-images/845/serverstudio.jpg/
Of course I read a lot about this error, but... Can`t figure out what to do to
make this work together...
Piotr
*******************************************************************************
Forum Note: Use "Reply" to post a response in the discussion forum.
IT Handel und Beratung Jörg Volz
Bernhard-Früh-Str. 7
77855 Achern
GERMANY
Tel: +49 (0)7841-681651
Fax: +49 (0)7841-681654
Mobil: +49 (0)170-2989757
VAT-ID: DE201383541
http://www.it-volz.de
i set EN_US.UTF8 & en_EN.57327 (in to db_locate and client_locate) values on server studio client and im getting something like this http://imageshack.us/photo/my-images/26/serverstudio2.jpg/ Im sure that i wrote correct, no letter mistake or etc. what can be wrong now?
Hi, Maybe there is someone who know what can be the reason of this problem? I cant figure it out... this problem just bring on me few sleepless nights;/
SOLVED... Probobly problem was just in client program, I next use visualstudio, and evrything was ok, connection, codepage and whole charset problem was solved. This or other way, thanks for help, Im glad the nightmare with charset is over:)