aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-12-23 10:13:11 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-12-23 10:13:11 +0000
commit6fcaf92943879dfbf8cff0354b6ea08aacadc8ea (patch)
treea07ec3d0a96d58b64795205c630d95c6d8aac92c
parentace35ac66c3df9beec76bbff7c75b37307930678 (diff)
downloadruby-6fcaf92943879dfbf8cff0354b6ea08aacadc8ea.tar.gz
* strftime.c (rb_strftime): use locale insensitive functions for tr_TR
locale. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20944 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--strftime.c8
-rw-r--r--test/ruby/test_time.rb1
3 files changed, 10 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 17e1a2873c..cff28b6d94 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Tue Dec 23 18:44:21 2008 Tanaka Akira <akr@fsij.org>
+
+ * strftime.c (rb_strftime): use locale insensitive functions for tr_TR
+ locale.
+
Tue Dec 23 17:38:03 2008 Tanaka Akira <akr@fsij.org>
* lib/test/unit/assertions.rb (assert_equal): show small differences
diff --git a/strftime.c b/strftime.c
index 248c695e01..38167fd384 100644
--- a/strftime.c
+++ b/strftime.c
@@ -627,8 +627,8 @@ rb_strftime(char *s, size_t maxsize, const char *format, const struct tm *timept
timeptr->tm_year + 1900L);
if (w < 0) goto err;
for (i = 3; i < 6; i++)
- if (islower(s[i]))
- s[i] = toupper(s[i]);
+ if (ISLOWER(s[i]))
+ s[i] = TOUPPER(s[i]);
s += w;
continue;
#endif
@@ -781,12 +781,12 @@ rb_strftime(char *s, size_t maxsize, const char *format, const struct tm *timept
switch (flags & (BIT_OF(UPPER)|BIT_OF(LOWER))) {
case BIT_OF(UPPER):
do {
- if (islower(*s)) *s = toupper(*s);
+ if (ISLOWER(*s)) *s = TOUPPER(*s);
} while (s++, --i);
break;
case BIT_OF(LOWER):
do {
- if (isupper(*s)) *s = tolower(*s);
+ if (ISUPPER(*s)) *s = TOLOWER(*s);
} while (s++, --i);
break;
default:
diff --git a/test/ruby/test_time.rb b/test/ruby/test_time.rb
index a1a5bfc7fb..b56fae0839 100644
--- a/test/ruby/test_time.rb
+++ b/test/ruby/test_time.rb
@@ -468,5 +468,6 @@ class TestTime < Test::Unit::TestCase
assert_equal("JAN", T2000.strftime("%#b"))
assert_equal("JANUARY", T2000.strftime("%#B"))
assert_equal("JAN", T2000.strftime("%#h"))
+ assert_equal("FRIDAY", Time.local(2008,1,4).strftime("%#A"))
end
end