PL/SQL Developer in Wine
Monday, August 31st, 2009I mentioned a couple of posts ago that I’d had to wipe my Ubuntu machine at work, replacing it with Windows 7, because PL/SQL Developer running via Wine refused to do extended characters properly. I was convinced at the time that this happened because Wine uses code page 437 by default, and I needed it to use code page 1252 (that is, a Western European code page rather than a US ASCII one). A commentator called Sokrates suggested I should set the Oracle NLS_LANG environment variable -but, although I had considered that at the time, I dismissed the idea because (a) setting a Linux environment variable didn’t seem, to me, to be a likely way to alter a Windows application’s settings and (b) that default code page 437 is definitely ‘wrong’ for doing extended characters -and thus seemed the most obvious line of attack.
Well, I should have listened to Sokrates!
So, first of all, here’s a video of me using the wine regedit command inside a Centos 5.3 virtual machine and noting the default, original code page settings. You’ll then see me run PL/SQL Developer, connect to a Windows 10.2.0.4 database, and encounter the problem of the disappearing extended characters. First, I create a procedure that uses extended characters and am able to compile it no problem… but when I re-open the code, all the extended characters have been stripped out or converted:
So that’s the problem. The question now is whether a code page setting in the registry will fix the problem, as I had hoped. In this next video, therefore, you’ll see me change the code page setting in the registry from its original 437 to 1252 (which is a code page that definitely supports extended characters). With the registry changed, I relaunch PL/SQL Developer and try to store my procedure with the correct extended characters re-inserted. Here’s how well that went:
Finally, I take Sokrates’ original advice and set the NLS_LANG environment variable to a locale that’s identical to the one being used by the database itself. I have to launch PL/SQL Developer from the command line this time, so that it picks up that new environment variable setting. Once it’s running, though, I do the same as before: paste back in my extended characters, re-compile the code… and then open the procedure back up to have a look at what got stored. Here’s how that turned out:
So, the good news is that I can have my Ubuntu installation back at work. The bad news is that I was an idiot to have dismissed an idea without having tried it out. Sorry, Sokrates. And thanks!
