Default Code Page
Posted: 29 Oct 2013 17:17
Whilst investigating topic Croatian characters not accepted in FH5 (10867) I have been experimenting with Windows Control Panel > Region and Language settings for System Locale and Default Code Page.
See http://blogs.msdn.com/b/michkap/archive ... 64707.aspx.
My interest is that Plugins such as Export Gedcom to TNG and Map Life Facts assume FH uses Code Page 1252.
But Region and Language can change the Code Page used by FH, and so the Plugins will make mistakes in encoding non-ASCII characters.
The Region and Language > Formats tab sets the Default User Locale which has no effect on FH, but can be detected in a Plugin by using LUA os.setlocale() that reports the Code Page number.
The Region and Language > Administrative > Change system locale sets the Default System Locale which determines the FH Code Page, but this is NOT reported by LUA os.setlocale().
So how can a Plugin determine the Code Page FH is using, to correctly translate GEDCOM characters into UTF-8, etc?
A solution would be something like fhGetContextInfo("CI_CODE_PAGE").
Another side effect is that GEDCOM files on PC using different Code Page settings cannot be exchanged without risking character corruptions.
See http://blogs.msdn.com/b/michkap/archive ... 64707.aspx.
My interest is that Plugins such as Export Gedcom to TNG and Map Life Facts assume FH uses Code Page 1252.
But Region and Language can change the Code Page used by FH, and so the Plugins will make mistakes in encoding non-ASCII characters.
The Region and Language > Formats tab sets the Default User Locale which has no effect on FH, but can be detected in a Plugin by using LUA os.setlocale() that reports the Code Page number.
The Region and Language > Administrative > Change system locale sets the Default System Locale which determines the FH Code Page, but this is NOT reported by LUA os.setlocale().
So how can a Plugin determine the Code Page FH is using, to correctly translate GEDCOM characters into UTF-8, etc?
A solution would be something like fhGetContextInfo("CI_CODE_PAGE").
Another side effect is that GEDCOM files on PC using different Code Page settings cannot be exchanged without risking character corruptions.