[#20320] Apollo.exeでsingleton_method_addedが効かない — Kazuhiro Yoshida <moriq@...>
もりきゅうです。
5 messages
2003/06/03
[#20335] 1.8 gsub — "H.Suzuki" <hsuzux@...>
hsuzu といいます。
7 messages
2003/06/08
[#20347] 1.8.0 preview3 schedule — matz@... (Yukihiro Matsumoto)
まつもと ゆきひろです
14 messages
2003/06/14
[#20357] Re: 1.8.0 preview3 schedule
— Koji Arai <JCA02266@...>
2003/06/16
新井です。
[#20358] Re: 1.8.0 preview3 schedule
— matz@... (Yukihiro Matsumoto)
2003/06/17
まつもと ゆきひろです
[#20360] Re: 1.8.0 preview3 schedule
— Koji Arai <JCA02266@...>
2003/06/17
新井です。
[#20362] [Oniguruma] quoting substring — kkosako@...
PerlとJavaの正規表現で実現されている
7 messages
2003/06/18
[#20389] Re: [Oniguruma] quoting substring
— Tanaka Akira <akr@...17n.org>
2003/06/19
In article <5FD2F0CF7F5D7F44B00F36870B9E78B508DE5040@SBG-EX4>,
[#20395] Re: [Oniguruma] quoting substring
— Tanaka Akira <akr@...17n.org>
2003/06/20
In article <87u1aloqtq.fsf@serein.a02.aist.go.jp>,
[#20374] case sensitivity of the names of environment variables — "U.Nakamura" <usa@...>
こんにちは、なかむら(う)です。
5 messages
2003/06/19
[#20379] locale and Marshal — Masao Mutoh <mutoh@...>
むとうです。
11 messages
2003/06/19
[#20381] Re: locale and Marshal
— matz@... (Yukihiro Matsumoto)
2003/06/19
まつもと ゆきひろです
[#20392] [BigDecimal] proposal to change specification — "Tadashi Saito" <shiba@...2.accsnet.ne.jp>
斎藤と申します。
25 messages
2003/06/20
[#20407] Re: [BigDecimal] proposal to change specification
— "Shigeo Kobayashi" <shigeo@...>
2003/06/22
小林です。
[#20412] Re: In 1.8.0 nil.to_s is not the same as "" — nobu.nakada@...
なかだです。
5 messages
2003/06/23
[#20416] ruby 1.8.0 preview3 — matz@... (Yukihiro Matsumoto)
まつもと ゆきひろです
11 messages
2003/06/23
[#20422] [BUG] SEGV on Alpha (Re: ruby 1.8.0 preview3)
— Minero Aoki <aamine@...>
2003/06/23
青木です。
[#20424] Re: [BUG] SEGV on Alpha (Re: ruby 1.8.0 preview3)
— matz@... (Yukihiro Matsumoto)
2003/06/23
まつもと ゆきひろです
[#20445] Re: *.soの autoload(PR#504) — nobu.nakada@...
なかだです。
13 messages
2003/06/24
[#20450] Re: *.soの autoload(PR#504)
— matz@... (Yukihiro Matsumoto)
2003/06/25
まつもと ゆきひろです
[#20451] Re: *.soの autoload(PR#504)
— Minero Aoki <aamine@...>
2003/06/25
青木です。
[#20454] Re: *.soのautoload(PR#504)
— nobu.nakada@...
2003/06/25
なかだです。
[#20455] Re: *.soのautoload(PR#504)
— Minero Aoki <aamine@...>
2003/06/25
青木です。
[#20457] Re: *.soのautoload(PR#504)
— matz@... (Yukihiro Matsumoto)
2003/06/25
[#20447] [BigDecimal] renaming proposal — "Tadashi Saito" <shiba@...2.accsnet.ne.jp>
斎藤です。
47 messages
2003/06/24
[#20598] Re: [BigDecimal] renaming proposal
— "Shigeo Kobayashi" <shigeo@...>
2003/07/10
小林です、またまたまとめて。
[#20600] Re: [BigDecimal] renaming proposal
— matz@... (Yukihiro Matsumoto)
2003/07/10
まつもと ゆきひろです
[#20621] Re: [BigDecimal] renaming proposal
— "Shigeo Kobayashi" <shigeo@...>
2003/07/11
小林@MAILチェック中です。
[#20628] Re: [BigDecimal] renaming proposal
— "Shigeo Kobayashi" <shigeo@...>
2003/07/11
小林です。
[#20648] Re: [BigDecimal] 標準添付案 [Re: Re: [BigDecimal] renaming proposal]
— "Shigeo Kobayashi" <shigeo@...>
2003/07/13
小林です。
[#20649] Re: [BigDecimal] 標準添付案
— "Shigeo Kobayashi" <shigeo@...>
2003/07/13
小林です。
[#20692] Re: [BigDecimal] 標準添付案 [Re: Re: [BigDecimal] renaming proposal]
— "Shigeo Kobayashi" <shigeo@...>
2003/07/16
小林です。
[#20462] 原因不明のSEGV — "yamamoto madoka" <dan@...2.so-net.ne.jp>
山本ともうします。
15 messages
2003/06/26
[#20473] Re: 原因不明のSEGV
— "yamamoto madoka" <dan@...2.so-net.ne.jp>
2003/06/27
山本です。
[#20474] Re: 原因不明のSEGV
— nobu.nakada@...
2003/06/27
なかだです。
[ruby-dev:20403] Re: locale and Marshal
From:
Masao Mutoh <mutoh@...>
Date:
2003-06-21 01:46:27 UTC
List:
ruby-dev #20403
むとうです。 On Sat, 21 Jun 2003 10:07:48 +0900 nobu.nakada@nifty.ne.jp wrote: > なかだです。 > > At Sat, 21 Jun 2003 09:45:49 +0900, > Masao Mutoh wrote: > > > > known problemです。sprintf(3)を使わずに(localeに影響されずに) > > > > 浮動小数点数を文字列化する手段がなかなか手に入らないので。 > > > > 逆は自前のstrtod(3)を用意することで対応したのですが。 > > > > > > ふと、思いついたのですが、(思いついただけですが) > > > localeconv(3) を使って decimal_point を得て、sprintf の結果を > > > decimal_point から "." に書き換えてしまうとか。 > > > > なるほど。せっかくですので上記を実装してみました。添付します。 > > locale.hとlocaleconv()はconfigureでチェックすべきでしょうね。 すみません...。改めまして。 でも、私、configure.inの書き方がよくわかっていないので これで良いのかはちょっと自信ないです。 それでは。 -- .:% Masao Mutoh<mutoh@highway.ne.jp>
Attachments (1)
marshal.patch2
(2.11 KB, text/x-diff)
Index: configure.in
===================================================================
RCS file: /src/ruby/configure.in,v
retrieving revision 1.175
diff -u -r1.175 configure.in
--- configure.in 9 Jun 2003 10:02:36 -0000 1.175
+++ configure.in 21 Jun 2003 01:42:57 -0000
@@ -353,7 +353,7 @@
AC_CHECK_HEADERS(stdlib.h string.h unistd.h limits.h sys/file.h sys/ioctl.h\
fcntl.h sys/fcntl.h sys/select.h sys/time.h sys/times.h sys/param.h\
syscall.h pwd.h grp.h a.out.h utime.h memory.h direct.h sys/resource.h \
- sys/mkdev.h sys/utime.h float.h)
+ sys/mkdev.h sys/utime.h float.h locale.h)
dnl Checks for typedefs, structures, and compiler characteristics.
AC_TYPE_UID_T
@@ -378,7 +378,7 @@
setrgid setegid setregid setresgid pause lchown lchmod\
getpgrp setpgrp getpgid setpgid getgroups setgroups getpriority getrlimit\
dlopen sigprocmask sigaction _setjmp setsid telldir seekdir fchmod\
- mktime timegm cosh sinh tanh)
+ mktime timegm cosh sinh tanh localeconv)
AC_STRUCT_TIMEZONE
AC_CACHE_CHECK(for struct tm.tm_gmtoff, rb_cv_member_struct_tm_tm_gmtoff,
[AC_TRY_COMPILE([#include <time.h>],
Index: marshal.c
===================================================================
RCS file: /src/ruby/marshal.c,v
retrieving revision 1.91
diff -u -r1.91 marshal.c
--- marshal.c 6 Jun 2003 09:24:59 -0000 1.91
+++ marshal.c 21 Jun 2003 01:42:57 -0000
@@ -15,6 +15,10 @@
#include "st.h"
#include "util.h"
+#ifdef HAVE_LOCALE_H
+#include <locale.h>
+#endif
+
#include <math.h>
#ifdef HAVE_FLOAT_H
#include <float.h>
@@ -292,10 +296,24 @@
}
else {
int len;
-
+#ifdef HAVE_LOCALECONV
+ int i;
+ struct lconv *lc;
+#endif
/* xxx: should not use system's sprintf(3) */
sprintf(buf, "%.*g", FLOAT_DIG, d);
len = strlen(buf);
+#ifdef HAVE_LOCALECONV
+ lc = localeconv();
+ if (lc->decimal_point[0] != '.'){
+ for (i=0; i<len; i++) {
+ if (buf[i] == lc->decimal_point[0]){
+ buf[i] = '.';
+ break;
+ }
+ }
+ }
+#endif
w_bytes(buf, len + save_mantissa(d, buf + len), arg);
return;
}