Csound Csound-dev Csound-tekno Search About

Re: [Cs-dev] call to strtod() in Csound engine

Date2007-10-05 20:54
FromVictor Lazzarini
SubjectRe: [Cs-dev] call to strtod() in Csound engine
That is more or less how I thought this should be
handled. We can test it after the release and
if it works, add it to 5.08.

Victor

>
> I googled around and found this code:
>
>
https://lists.linux-foundation.org/pipermail/printing-driver/2005/000997.html
>
> in that file it forces locale but restores after needing
> it in the locale required, wrapping with:
>
> setlocale(LC_ALL, "C");
> [... some code that requires locale C...]
> setlocale(LC_ALL, "");
>
> Maybe we can just do that?  Could even make a wrapper
> function for strod, something like:
>
> double csound_strtod(const char *nptr, char **endptr) {
>   double returnValue;
>
>   setlocale(LC_ALL, "C");
>   returnValue = strtod(nptr, endptr);
>   setlocale(LC_ALL, "");
>
>   return returnValue;
> }
>
> and use that.
>
> Thoughts?
>
> steven
>
>
> On 10/5/07, Victor Lazzarini 
> > wrote: it looks like the way otran.c calls strtod() to
> > check numeric values is buggy, because it assumes a
> > certain locale and if the default encoding is changed
> > from ascii, say to UTF-8, then the parsing fails,
> >
> > Some solutions were offered, one is to reimplement it
> > using the dietlibc code. What do you think?
> >
> > Victor
> > Victor Lazzarini
> > Music Technology Laboratory
> > Music Department
> > National University of Ireland, Maynooth
> >
> >
> >
> ----------------------------------------------------------
> > --------------- This SF.net email is sponsored by:
> > Splunk Inc. Still grepping through log files to find
> > problems?  Stop. Now Search log events and configuration
> > files using AJAX and a browser. Download your FREE copy
> > of Splunk now >> http://get.splunk.com/
> > _______________________________________________
> > Csound-devel mailing list
> > Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel
> >
>
> ----------------------------------------------------------
> --------------- This SF.net email is sponsored by: Splunk
> Inc. Still grepping through log files to find problems?
> Stop. Now Search log events and configuration files using
> AJAX and a browser. Download your FREE copy of Splunk now
> >> http://get.splunk.com/
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2007-10-05 22:55
From"Mike Coleman"
SubjectRe: [Cs-dev] call to strtod() in Csound engine
AttachmentsNone  

Date2007-10-05 23:17
From"Steven Yi"
SubjectRe: [Cs-dev] call to strtod() in Csound engine
AttachmentsNone