<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>Hi!! Symbians setlocale is more or less just a stubbed version and does not do much good. What should be needed is a replacement implementation of sscanf (like the one mentioned before) or an engine change.<br><br>Btw I have seen lots of problems with the sscanf and other libc implementations since the supported syntax for input actually varies from platform to platform. So the ideal solution would be to remove this dependency from the engine it self.<br><br>Best regard<br>Lars<br><br>> Date: Thu, 19 Feb 2015 13:58:38 +0100<br>> From: eriktorbjorn@telia.com<br>> To: bluegr@gmail.com; fedor_qd@mail.ru<br>> CC: Scummvm-devel@lists.sourceforge.net<br>> Subject: Re: [Scummvm-devel] setlocale() doesn't work at Symbian<br>> <br>> There is a sscanf() implementation in <br>> backends/platform/tizen/sscanf.cpp. I don't know the story behind it, <br>> but it might be a good starting point.<br>> <br>> However, it seems to be missing at the very least floating-point support <br>> and assignment-suppression (e.g. "%*u"), both of which are currently <br>> used by ZVision.<br>> <br>> Torbjörn Andersson<br>> <br>> On 2015-02-19 12:14, Filippos Karapetis wrote:<br>> > Well, it looks like sscanf() on Symbian isn't handling floating-point math<br>> > correctly (same as most floating point calculations in Symbian).<br>> ><br>> > This StackOverflow question seems to verify this similar behavior with<br>> > atof() under Symbian:<br>> > http://stackoverflow.com/questions/11895686/atof-is-not-taking-entire-value-in-symbian<br>> ><br>> > If that is indeed the case, the only way to make this work is to roll our<br>> > own version of sscanf(), and handle floating-point math for Symbian in<br>> > there.<br>> ><br>> > But that does sound like a major task...<br>> ><br>> > Regards<br>> > Filippos<br>> ><br>> ><br>> ><br>> > On Wed, Feb 18, 2015 at 8:43 PM, Федор <fedor_qd@mail.ru> wrote:<br>> ><br>> >> Result is same.<br>> >><br>> >><br>> >> Fedor Strizhnev<br>> >> Федор Стрижнёв.<br>> >><br>> >> Серада, 18 лютага 2015, 20:35 +02:00 ад Filippos Karapetis <<br>> >> bluegr@gmail.com>:<br>> >><br>> >> You're getting wrong results for sscanf(), which is why ZVision isn't<br>> >> working for you<br>> >><br>> >> Try putting this line:<br>> >> setlocale(LC_ALL, "C");<br>> >> before your test code and try again<br>> >><br>> >> On Wed, Feb 18, 2015 at 8:23 PM, Федор <fedor_qd@mail.ru<br>> >> <https://e.mail.ru/compose/?mailto=mailto%3afedor_qd@mail.ru>> wrote:<br>> >><br>> >> I have:<br>> >> Test dot: 30.000000<br>> >> Test comma: 30.000000<br>> >><br>> >> I confused.<br>> >><br>> >> Fedor Strizhnev<br>> >> Федор Стрижнёв.<br>> >><br>> >> Серада, 18 лютага 2015, 14:44 UTC ад Willem Jan Palenstijn <<br>> >> wjp@usecode.org<br>> >> <https://e.mail.ru/compose/?mailto=mailto%3awjp@usecode.org>>:<br>> >><br>> >> On Wed, Feb 18, 2015 at 02:42:08PM +0300, Fiodar Strizhniou wrote:<br>> >>> Is this test code good?<br>> >>><br>> >>><br>> >>> sscanf("30.981", "%f", &y)<br>> >>> printf("Test dot: \n")<br>> >>> print y;<br>> >>> sscanf("30,981", "%f", &y)<br>> >>> printf("Test comma: \n")<br>> >>> print y;<br>> >><br>> >><br>> >> I had a quick look at how ZVision uses sscanf, and something like that<br>> >> sounds<br>> >> good, yes.<br>> >><br>> >> If you want something that actually compiles, try:<br>> >><br>> >> float y;<br>> >> sscanf("30.981", "%f", &y);<br>> >> printf("Test dot: %f\n", y);<br>> >> sscanf("30,981", "%f", &y);<br>> >> printf("Test comma: %f\n", y);<br>> >><br>> >><br>> >> You should get as output:<br>> >><br>> >> Test dot: 30.981001<br>> >> Test comma: 30.000000<br>> >><br>> >><br>> >> -Willem Jan<br>> >><br>> >><br>> >>> исходное сбщ<br>> >>> Тема: Re: [Scummvm-devel] setlocale() doesn't work at Symbian<br>> >>> От: Федор <fedor_qd@mail.ru<br>> >> <https://e.mail.ru/compose?To=fedor_qd@mail.ru>><br>> >>> Дата: 17.02.2015 17.44<br>> >>><br>> >>> I don't know what I need to test. Can you give me peace of code?<br>> >>><br>> >>><br>> >>> Fedor Strizhnev<br>> >>> Федор Стрижнёв.<br>> >>><br>> >>> Аўторак, 17 лютага 2015, 13:47 UTC ад Willem Jan Palenstijn <<br>> >> wjp@usecode.org <https://e.mail.ru/compose?To=wjp@usecode.org>>:<br>> >>>> On Tue, Feb 17, 2015 at 04:06:00PM +0300, Fiodar Strizhniou wrote:<br>> >>>>> I create bugreport month ago about bad colours in most scenes in<br>> >> Zvision engine games. I get point to wrong setlocale() settings in some<br>> >> backends. I create and run test app. Nothing works(see screenshot). Also i<br>> >> have read somewhere in Symbian Sdk docs what setlocale doesnt work at<br>> >> Symbian.<br>> >>>><br>> >>>><br>> >>>> You should really say things like that directly, instead of having us<br>> >> guess at<br>> >>>> what you're trying to do.<br>> >>>><br>> >>>><br>> >>>> The main question is: does sscanf work with "%f" for you? And if you<br>> >> set locale<br>> >>>> to "C" explicitly?<br>> >>>><br>> >>>><br>> >>>> -Willem Jan<br>> >>>><br>> >>>><br>> >>>><br>> >>>>> исходное сбщ<br>> >>>>> Тема: Re: [Scummvm-devel] setlocale() doesn't work at Symbian<br>> >>>>> От: Filippos Karapetis < bluegr@gmail.com<br>> >> <https://e.mail.ru/compose?To=bluegr@gmail.com> ><br>> >>>>> Дата: 17.02.2015 14.52<br>> >>>>><br>> >>>>> You don't use a correct value for the locale<br>> >>>>><br>> >>>>> You would want something like:<br>> >>>>> setlocale(LC_ALL,"en_GB.ISO-8859-1");<br>> >>>>><br>> >>>>> Having said that, check backends/platform/sdl/sdl.cpp, where it does<br>> >> this:<br>> >>>>> const Common::String locale = setlocale(LC_ALL, "");<br>> >>>>><br>> >>>>> // Restore default C locale to prevent issues with<br>> >>>>> // portability of sscanf(), atof(), etc.<br>> >>>>> // See bug #3615148<br>> >>>>> setlocale(LC_ALL, "C");<br>> >>>>><br>> >>>>> Be careful when changing the locale, you need to reset it afterwards<br>> >> (as<br>> >>>>> the comment mentions).<br>> >>>>><br>> >>>>> This stackoverflow question may be helpful:<br>> >>>>><br>> >> http://stackoverflow.com/questions/3191664/list-of-all-locales-and-their-short-codes<br>> >>>>><br>> >>>>> On Tue, Feb 17, 2015 at 1:08 PM, Fiodar Strizhniou < fedor_qd@mail.ru<br>> >> <https://e.mail.ru/compose?To=fedor_qd@mail.ru> > wrote:<br>> >>>>><br>> >>>>>> I write simple application and run on phone:<br>> >>>>>> printf("Locale is: %s\n", setlocale(LC_ALL, "en_GB"));<br>> >>>>>> Locale is NULL<br>> >>>>>> Which parts (decimal separators, etc) should be set? Which values<br>> >> from<br>> >>>>>> setlocale() used?<br>> >>>>>> Always yours, Strizhniou Fedor.<br>> >>>>>> С уважением, Стрижнёв Фёдор.<br>> >>>>>><br>> >>>>><br>> >>>>><br>> >>>>> --<br>> >>>>> "Experience is the name every one gives to their mistakes" - Oscar<br>> >> Wilde<br>> >>>><br>> >>><br>> >>><br>> >>><br>> >> ------------------------------------------------------------------------------<br>> >>> Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server<br>> >>> from Actuate! Instantly Supercharge Your Business Reports and Dashboards<br>> >>> with Interactivity, Sharing, Native Excel Exports, App Integration & more<br>> >>> Get technology previously reserved for billion-dollar corporations, FREE<br>> >>><br>> >> http://pubads.g.doubleclick.net/gampad/clk?id=190641631&iu=/4140/ostg.clktrk<br>> >>> _______________________________________________<br>> >>> Scummvm-devel mailing list<br>> >>> Scummvm-devel@lists.sourceforge.net<br>> >> <https://e.mail.ru/compose?To=Scummvm%2ddevel@lists.sourceforge.net><br>> >>> https://lists.sourceforge.net/lists/listinfo/scummvm-devel<br>> >><br>> >><br>> >> ------------------------------------------------------------------------------<br>> >> Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server<br>> >> from Actuate! Instantly Supercharge Your Business Reports and Dashboards<br>> >> with Interactivity, Sharing, Native Excel Exports, App Integration & more<br>> >> Get technology previously reserved for billion-dollar corporations, FREE<br>> >><br>> >> http://pubads.g.doubleclick.net/gampad/clk?id=190641631&iu=/4140/ostg.clktrk<br>> >> _______________________________________________<br>> >> Scummvm-devel mailing list<br>> >> Scummvm-devel@lists.sourceforge.net<br>> >> <https://e.mail.ru/compose?To=Scummvm%2ddevel@lists.sourceforge.net><br>> >> https://lists.sourceforge.net/lists/listinfo/scummvm-devel<br>> >><br>> >><br>> >><br>> >><br>> >><br>> >> --<br>> >> "Experience is the name every one gives to their mistakes" - Oscar Wilde<br>> >><br>> >><br>> >><br>> ><br>> ><br>> ><br>> ><br>> > ------------------------------------------------------------------------------<br>> > Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server<br>> > from Actuate! Instantly Supercharge Your Business Reports and Dashboards<br>> > with Interactivity, Sharing, Native Excel Exports, App Integration & more<br>> > Get technology previously reserved for billion-dollar corporations, FREE<br>> > http://pubads.g.doubleclick.net/gampad/clk?id=190641631&iu=/4140/ostg.clktrk<br>> ><br>> ><br>> ><br>> > _______________________________________________<br>> > Scummvm-devel mailing list<br>> > Scummvm-devel@lists.sourceforge.net<br>> > https://lists.sourceforge.net/lists/listinfo/scummvm-devel<br>> ><br>> <br>> <br>> ------------------------------------------------------------------------------<br>> Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server<br>> from Actuate! Instantly Supercharge Your Business Reports and Dashboards<br>> with Interactivity, Sharing, Native Excel Exports, App Integration & more<br>> Get technology previously reserved for billion-dollar corporations, FREE<br>> http://pubads.g.doubleclick.net/gampad/clk?id=190641631&iu=/4140/ostg.clktrk<br>> _______________________________________________<br>> Scummvm-devel mailing list<br>> Scummvm-devel@lists.sourceforge.net<br>> https://lists.sourceforge.net/lists/listinfo/scummvm-devel<br> </div></body>
</html>