On 13/08/2012 08:28, Alex Peshkoff wrote: >> This seems completely wrong solution. Our caller may not even have easy >> access to setlocale (of the same CRT as ours). >> > Taking into an account that posix build is used not only on linux (have > you ever seen linux with >1 CRT?) I can agree with this argument.
I did not even thought about it. What's nice about Firebird is that it almost always works identically, be it embedded, be it Linux/Windows. Have callers code to detect per operating system obscure settings and change them seems against Firebird philosophy. >> Also there may be interdependent library which one needs it, and another >> could not work well with it. >> >> If this is not a bug or some problem in our usage, that seems to be the >> wrong library call we're doing, our the design of intl things in Linux >> is very broken. > Appears that according to man we really MUST initialize locales using > setlocale(). What we see in man: > >> On startup of the main program, the portable "C" locale is selected as >> default. A program may be made portable to all locales by calling: >> setlocale(LC_ALL, ""); Isn't it much better to get the current locale from $LANG instead of use nl_langinfo? > I.e. we really need to do that init in main library (yValve, not engine) > in order to make posix locales work. > > Which is also a bad thing, tweaking process-wide settings in library code. Please re-read thread "isql history broken with libedit 3.0". setlocale (introduced in ISQL) caused bugs and malfunction of sprintf when the data does not match the locale. This is not something I trust to put in the non-embedded code (nor the embedded, actually). Adriano ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ Firebird-Devel mailing list, web interface at https://lists.sourceforge.net/lists/listinfo/firebird-devel