Code Page Changes

Open forum for end-user questions about Wine. Before asking questions, check out the Wiki as a first step.
Forum Rules
Locked
dizwell
Newbie
Newbie
Posts: 4
Joined: Fri Aug 28, 2009 6:24 pm

Code Page Changes

Post by dizwell »

I'm running PL/SQL Developer under Wine in order to do development work with an Oracle database. I created a procedure that, at one point, used extended characters (things like ăÿæç and so on). When that was compiled, however, all those characters were stored simply as question marks, which is Oracle's way of telling you that there is a code page mismatch (i.e., that your client has submitted a character code for which there is no valid match in the database character set).

If I was running natively on Windows, I would at this point issue the command chcp 850 and re-launch PL/SQL Developer. Now the client tool runs with the right code page, the extended characters get stored correctly (I fired up Windows in a virtual machine to prove this).

However, I don't know what the equivalent is in Wine, or if such a code page change is even possible there.

I know it's not a problem with my Linux install itself, because if run the java-based SQL Developer application, that allows me to type in and store the correct extended descriptions, natively in Linux. The problem only arises when I run an application with Wine.

If anyone can tell me how to configure/re-configure/dynamically alter the code page that Wine apps run in, I would be grateful.
vitamin
Moderator
Moderator
Posts: 6605
Joined: Sat Feb 23, 2008 2:29 pm

Re: Code Page Changes

Post by vitamin »

dizwell wrote:However, I don't know what the equivalent is in Wine, or if such a code page change is even possible there.
Set "LANG" to the locale you need.
dizwell
Newbie
Newbie
Posts: 4
Joined: Fri Aug 28, 2009 6:24 pm

Post by dizwell »

I'm guessing you are talking about the $LANG environment variable? Already set to en_AU.UTF-8 if so, and yet the problem arises.

And as I say, in the Java SQL Developer program, running natively on Linux and therefore fully aware of my $LANG settings, along with all the other environment variables, I have no problem storing/compiling extended characters into the code.

This is a Wine-specific thing, therefore. Setting a generic Linux environment variable is not going to fix it (and, more pertinently perhaps, has not done so).

Any other suggestions, please?
Gert van den Berg

Code Page Changes

Post by Gert van den Berg »

On Sat, Aug 29, 2009 at 03:44, dizwell<[email protected]> wrote:
I'm guessing you are talking about the $LANG environment variable? Already set to en_AU.UTF-8 if so, and yet the problem arises.
A CP850 locale might work better than a UTF-8 one... (Not sure, but
LANG=C might be nearer to CP850 (which is AFAIK the OLD DOS "Extended
ASCII"))

You can try converting the file to a modern encoding.... (iconv seem
to be the tool for this) (Code page 850 was replaced in Windows 3.1
according to MSDN)

Gert
dizwell
Newbie
Newbie
Posts: 4
Joined: Fri Aug 28, 2009 6:24 pm

Post by dizwell »

Well, thanks for that, but I think the point is that the specifics don't matter. I'd just like to be able to set something that PL/SQL Developer actually picks up on!

I did wine regedit, for example, in order to set the HKEY_LOCAL_MACHINE/System/CurrentControlSet/Control/Nls/Codepage/OEMCP value to 1252. I set it no problem... but when I launch PL/SQL Developer after doing so, there is no change in the behaviour... so I go and do another wine regedit and OEMCP has reverted to 437 (which is the US ASCII code page and is the fundamental reason why my extended characters won't pass properly to the database).

So, whether it's a code page 850, 1252 or 65001 is really immaterial. Once I find a way to *set* the code page properly, then I can experiment as to which code page produces the best result or is "the most modern" encoding. But I am falling at the first hurdle: How do I set the correct code page, persistently, so that all Wine apps pick it up? And setting $LANG is not the answer (because I've already tried export LANG=en_AU.ISO8859-1, which matches the database character set precisely, and it made not one bit of difference).

Can anyone tell me why a change to the registry made as described above is not persistent? Is there a Wine.cfg file or something I need to edit instead?
dizwell
Newbie
Newbie
Posts: 4
Joined: Fri Aug 28, 2009 6:24 pm

Post by dizwell »

Well, I'm still none the wiser as to why my registry changes won't 'stick', but even when they occasionally do, they don't seem to make any difference.

But, thanks to suggestions made elsewhere, I have cured the problem using a different technique -and should anyone else ever wonder about the same problem, I have documented the cure here: http://diznix.com/2009/08/31/plsql-developer-in-wine/
vitamin
Moderator
Moderator
Posts: 6605
Joined: Sat Feb 23, 2008 2:29 pm

Post by vitamin »

dizwell wrote:Can anyone tell me why a change to the registry made as described above is not persistent?
The registry key you attempting to change is automatically reset by Wine. That's why you have to have correct locale settings outside of Wine.
Locked