Thread: [ODBC] Connectivity error: Could not convert from the current locale to wide characters

After installing latest odbc driver my application throws error

Connectivity error: Could not convert from the current locale to wide
characters

Application runs in Windows 10 in windows-1257 locale
Using unicode driver
Postgres 9.6
database encoding is unicode

How to fix this?
How to force earlier driver behaviour which worked OK ?

Andrus.



Hi Andrus,

On 2017/08/24 4:18, Andrus wrote:
> After installing latest odbc driver my application throws error
>
> Connectivity error: Could not convert from the current locale to wide
> characters

Does *Connectivity error* mean an error on connection?
If so, could you send me the Mylog output of the failure?

regards,
Hiroshi Inoue

>
>
> Application runs in Windows 10 in windows-1257 locale
> Using unicode driver
> Postgres 9.6
> database encoding is unicode
>
> How to fix this?
> How to force earlier driver behaviour which worked OK ?
>
> Andrus



Hi,

> After installing latest odbc driver my application throws error
>
> Connectivity error: Could not convert from the current locale to wide
> characters

>Does *Connectivity error* mean an error on connection?

If psqlodbc_09_00_0101.msi  driver is used, this error does not occur.

>If so, could you send me the Mylog output of the failure?

Logs are attached.
They doesnt contain error or communication information. They contain very
few information.

Andrus.

>
>
> Application runs in Windows 10 in windows-1257 locale
> Using unicode driver
> Postgres 9.6
> database encoding is unicode
>
> How to fix this?
> How to force earlier driver behaviour which worked OK ?
>
> Andrus

Attachment
Hi Andrus,

On 2017/08/25 5:39, Andrus wrote:
> Hi,
>
>> After installing latest odbc driver my application throws error
>>
>> Connectivity error: Could not convert from the current locale to wide
>> characters
>
>> Does *Connectivity error* mean an error on connection?
>
> If psqlodbc_09_00_0101.msi  driver is used, this error does not occur.
>
>> If so, could you send me the Mylog output of the failure?
>
> Logs are attached.

Thanks.

> They doesnt contain error or communication information. They contain
> very few information.

Could you turn on the Debug option in Advanced options (DataSource) page
As well?

regards,
Hiroshi Inoue

>
> Andrus.
>
>>
>>
>> Application runs in Windows 10 in windows-1257 locale
>> Using unicode driver
>> Postgres 9.6
>> database encoding is unicode
>>
>> How to fix this?
>> How to force earlier driver behaviour which worked OK ?
>>
>> Andrus


Hi,

Thank you.

>Could you turn on the Debug option in Advanced options (DataSource) page As 
>well?

I looked into all pages 1-3 ion advanced options.
There is no Debug option in any place in ODBC config.

Aslo in page 1 (screenshot attached) it looks like driver tries to write 
logs into root directory in c: drive.
In my knowldedge, this is disabled by default in newer windows OSes.
I can turn of Windows ODBC tracing and send this log if it helps.

Andrus.

-- 
Sent via pgsql-odbc mailing list (pgsql-odbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-odbc

Attachment
Hi Andrus,

On 2017/08/25 16:05, Andrus wrote:
> Hi,
>
> Thank you.
>
>> Could you turn on the Debug option in Advanced options (DataSource)
>> page As well?
>
> I looked into all pages 1-3 ion advanced options.
> There is no Debug option in any place in ODBC config.

Oops sorry, it is Mylog option. in page 1 which should be turned on.

>
> Aslo in page 1 (screenshot attached) it looks like driver tries to
> write logs into root directory in c: drive.
> In my knowldedge, this is disabled by default in newer windows OSes.
> I can turn of Windows ODBC tracing and send this log if it helps.

Probably ODBC trace is useless in this case.
ISTM You sent me Mylog with global Mylog option is turned on.
Mylog output with per datasource Mylog option turned on is necessary.

regards,
Hiroshi Inoue


Hi,

> Oops sorry, it is Mylog option. in page 1 which should be turned on.
>Probably ODBC trace is useless in this case.

It contains error mentioned message

Could not convert from the current locale to wide characters

Maybe come character in data causes this and it may be visible in this log.

>ISTM You sent me Mylog with global Mylog option is turned on.
>Mylog output with per datasource Mylog option turned on is necessary.

Mylog was turned on in datasource page also.

I tried again. Turned mylog on only in datasource page, disabled UAC in
windows 10 and run application with administrative rights.
After that searched for mylog*.log files in C: drive.
Those files are not created.

My application does not use named datasource. It uses direct connection
string

DRIVER={PostgreSQL
Unicode};DATABASE=somedb;SERVER=localhost;PORT=5432;UID=postgres;Protocol=-0;B9=0;C7=0

Maybe log is not created due to this.

Andrus.



Hi Andrus,

On 2017/08/25 17:39, Andrus wrote:
> Hi,
>
>> Oops sorry, it is Mylog option. in page 1 which should be turned on.
>> Probably ODBC trace is useless in this case.
>
> It contains error mentioned message
>
> Could not convert from the current locale to wide characters
>
> Maybe come character in data causes this and it may be visible in this
> log.
>
>> ISTM You sent me Mylog with global Mylog option is turned on.
>> Mylog output with per datasource Mylog option turned on is necessary.
>
> Mylog was turned on in datasource page also.
>
> I tried again. Turned mylog on only in datasource page, disabled UAC
> in windows 10 and run application with administrative rights.
> After that searched for mylog*.log files in C: drive.
> Those files are not created.
>
> My application does not use named datasource. It uses direct
> connection string
>
> DRIVER={PostgreSQL
> Unicode};DATABASE=somedb;SERVER=localhost;PORT=5432;UID=postgres;Protocol=-0;B9=0;C7=0

Please add Debug=1 so as to take Mylog.

regards,
Hiroshi Inoue

>
>
> Maybe log is not created due to this.
>
> Andrus.