Format function in report works different on mac and windows

Ruslan Zasukhin ruslan_zasukhin at valentina-db.com
Fri Nov 16 05:50:27 CST 2012


On 15/11/2012 08:47, "Fabian Eschrich" <info at faesch.de> wrote:

> Hi Ruslan,
> 
> we tested again with a local mac installation yesterday. Also on a german
> system and we also got $ inside the report. So it seems locale is detected
> wrong on mac.
> 
> Best regards
> 
> Fabian

Hi Fabian,

In short. We think we have FIX this.
Will be available in next beta build for MAC.

Source of problem is described below.


FYI.  In near future we going add into Valentina Reports feature to specify
few localizations of the same report.




> Hi Guys,
> 
> 1) For years we have used uloc_getDefault() to get default "system" locale
> from ICU, which we later use as locale for new database on disk.
> 
> But yesterday we have note, that even if we change in System Prefs of OS X
> for example, to:
>       Language          Deutsch
>       Region              Deutschland
> 
> 
> uloc_getDefault() always returns "en_us_POSIX"
> 
> 
> 2) I have spent some time in google, and it looks that uloc_getDefault()
> returns some very basic system root locale ...  But not the current one.
> 
> 
> 3) In Apples docs, I have found code that gives what we need:
> 
>     CFLocaleRef loc = CFLocaleGetCurrent();
> 
>     CFStringRef countryCode = CFLocaleGetValue (loc, kCFLocaleCountryCode);
> 
>     CFArrayRef langs = CFLocaleCopyPreferredLanguages();
>     CFStringRef langCode = CFArrayGetValueAtIndex (langs, 0);
> 
> So we can get "DE" + "de",  or "GB" + "en".
> 
> Important is that here place CFLocaleGetCurrent() -- for CURRENT user.
> 
> 
> 
> 4) Question: can we do the same using native ICU API ?
> If not then why such obvious feature is not added into ICU for years?
> 
> If not, then we are forced to use OS-dependent code for each of 3 OS?

-- 
Best regards,

Ruslan Zasukhin
VP Engineering and New Technology
Paradigma Software, Inc

Valentina - Joining Worlds of Information
http://www.paradigmasoft.com

[I feel the need: the need for speed]




More information about the Valentina-beta mailing list