August 27, 2014 at 8:47 am #785
After changing “Region and Language” –> “Language for non-Unicode programs” in windows 7 to a different language, when I try to login suneido, the database crashes saying it needs to be restored.
This seems to be a big topic related to database character set/codepage stuff. I am not good in this area, only saw some other databases implemented codepage setup options. For now, I just want to implement a check which compares the client OS language setup with server OS language setup. If they don’t match, an error is prompted.
I see suneido could retrieve the OS date format setup which leads me to believe this could be possible.
Any idea is appreciated.August 27, 2014 at 4:15 pm #1085amckinlayKeymaster
If Suneido crashes (or the process is killed), then the next time you run it, it will require a rebuild.
I am not sure why the code page would make it crash. It might cause something to fail e.g. in Init or somewhere else in the GUI, but that should not cause a crash.
The database itself doesn’t care about character sets or code pages. It just stores 8 bit chars. Changing the character set or code page will not make the database invalid or cause a rebuild. If different clients interpret the data in different ways then that could cause problems.
To compare client to server, you can use ServerEval to run code on the server e.g to get the language setup.August 28, 2014 at 1:40 am #1086
This happened a few weeks back when I tried to flip around between English and Thai language setup. And it happened couple of times. I thought I could always warn the customer to use the same language setup before they login the system, so I gave it a lower priority.
But today, when i try to reproduce the same issue, it does not happen. Maybe I haven’t got the environment setup right.
Nonetheless, this is necessary in my case. When one user is typing unicode language like Thai under Thai language setup, he can type and see Thai characters nicely. But if another user is connecting to the system with a different language setup like English, he wont be able to see or type Thai, the Thai characters are shown as unreadable strings. So, a check to make sure this setup is consistent across all clients makes sense.
I will give it a try later, thanks a lot andrew!August 28, 2014 at 2:47 pm #1087
In order to compare “Language for non-Unicode programs” under control panel from both client and server, I first tried to retrieve the language code. But i couldn’t find the right constant to pass into method:
GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE.SLONGDATE, buf = Buffer(80), 80)
There is a website which provides some constants and I have tried most of them but it didnt give me what I wanted.
ThanksAugust 28, 2014 at 5:45 pm #1088amckinlayKeymaster
I found this:
Suneido doesn’t have definitions for the functions it talks about, but they should not be hard to addAugust 29, 2014 at 6:53 am #1089
nice, a new class “GetSystemDefaultLocaleName” worked out,
dll long Kernel32:GetSystemDefaultLCID()
It returns 1054 which matches “Language for non-Unicode programs” setup according to Microsoft language id definitions.
- You must be logged in to reply to this topic.