From: Bob D. <bd...@si...> - 2005-05-13 13:14:11
|
Hello, > Hungarian problems again. :-) ;) What you want to do seems Fine. I know Chet @ SICOM did something in libsrc/pdf.c which is **supposed** to not allow this to happen. Have a look in there. It should really be fixed in RPDF though. Feel free to make the patch :) If you do fix it @ the RPDF level perhaps you can biff the libsrc/pdf.c stuff also since RPDF is really the place to fix it > Now I reached a phase where my program actually compiles and works > under Windows, and links to RLIB. But the resulting PDF is unusable. > Of course I saved it in an O_BINARY file. The problem is that printf(), > et.al. are conforming to the locale settings, so controlling numbers > in the PDFs are written as e.g. > > /Frpdf0 9,000 Tf > > instead of > > /Frpdf0 9.000 Tf > > since the decimal separator is a comma, not a dot here in Hungary. > > A simple trick will do it (I fixed unixODBC this way in 2000): > > ------------------------------------------- > char *saved_locale; > > saved_locale = strdup(setlocale(LC_ALL, NULL)); > > /* national decimal separator here */ > setlocale(LC_ALL, "C"); > /* decimal dots strictly required here */ > setlocale(LC_ALL, saved_locale); > /* national decimal separator again */ > free(saved_locale); > ------------------------------------------- > > Fortunately setlocale() exists under MingW, too. > > I haven't made a patch against RPDF yet, but you know better > where to fix it. |