diff --git a/ChangeLog b/ChangeLog index 1b5d012078..da3cfb3310 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Mon May 30 21:15:37 2016 Martin Duerst + + * string.c: Document current behavior for other case mapping methods + on String. [ci skip] + Mon May 30 20:00:25 2016 Martin Duerst * string.c: Document current situation for String#downcase. [ci skip] diff --git a/string.c b/string.c index 24bcbeecfd..1fe74290c7 100644 --- a/string.c +++ b/string.c @@ -5827,11 +5827,13 @@ rb_str_casemap(VALUE source, OnigCaseFoldType *flags, rb_encoding *enc) /* * call-seq: - * str.upcase! -> str or nil + * str.upcase! -> str or nil + * str.upcase!([options]) -> str or nil * * Upcases the contents of str, returning nil if no changes * were made. - * Note: case replacement is effective only in ASCII region. + * + * See String#downcase for meaning of +options+ and use with different encodings. */ static VALUE @@ -5895,12 +5897,13 @@ rb_str_upcase_bang(int argc, VALUE *argv, VALUE str) /* * call-seq: - * str.upcase -> new_str + * str.upcase -> new_str + * str.upcase([options]) -> new_str * * Returns a copy of str with all lowercase letters replaced with their - * uppercase counterparts. The operation is locale insensitive---only - * characters ``a'' to ``z'' are affected. - * Note: case replacement is effective only in ASCII region. + * uppercase counterparts. + * + * See String#downcase for meaning of +options+ and use with different encodings. * * "hEllO".upcase #=> "HELLO" */ @@ -5915,11 +5918,13 @@ rb_str_upcase(int argc, VALUE *argv, VALUE str) /* * call-seq: - * str.downcase! -> str or nil + * str.downcase! -> str or nil + * str.downcase!([options]) -> str or nil * * Downcases the contents of str, returning nil if no * changes were made. - * Note: case replacement is effective only in ASCII region. + * + * See String#downcase for meaning of +options+ and use with different encodings. */ static VALUE @@ -6037,11 +6042,13 @@ rb_str_downcase(int argc, VALUE *argv, VALUE str) /* * call-seq: - * str.capitalize! -> str or nil + * str.capitalize! -> str or nil + * str.capitalize!([options]) -> str or nil * * Modifies str by converting the first character to uppercase and the * remainder to lowercase. Returns nil if no changes are made. - * Note: case conversion is effective only in ASCII region. + * + * See String#downcase for meaning of +options+ and use with different encodings. * * a = "hello" * a.capitalize! #=> "Hello" @@ -6093,11 +6100,13 @@ rb_str_capitalize_bang(int argc, VALUE *argv, VALUE str) /* * call-seq: - * str.capitalize -> new_str + * str.capitalize -> new_str + * str.capitalize([options]) -> new_str * * Returns a copy of str with the first character converted to uppercase * and the remainder to lowercase. - * Note: case conversion is effective only in ASCII region. + * + * See String#downcase for meaning of +options+ and use with different encodings. * * "hello".capitalize #=> "Hello" * "HELLO".capitalize #=> "Hello" @@ -6115,11 +6124,13 @@ rb_str_capitalize(int argc, VALUE *argv, VALUE str) /* * call-seq: - * str.swapcase! -> str or nil + * str.swapcase! -> str or nil + * str.swapcase!([options]) -> str or nil * * Equivalent to String#swapcase, but modifies the receiver in * place, returning str, or nil if no changes were made. - * Note: case conversion is effective only in ASCII region. + * + * See String#downcase for meaning of +options+ and use with different encodings. */ static VALUE @@ -6163,11 +6174,13 @@ rb_str_swapcase_bang(int argc, VALUE *argv, VALUE str) /* * call-seq: - * str.swapcase -> new_str + * str.swapcase -> new_str + * str.swapcase([options]) -> new_str * * Returns a copy of str with uppercase alphabetic characters converted * to lowercase and lowercase characters converted to uppercase. - * Note: case conversion is effective only in ASCII region. + * + * See String#downcase for meaning of +options+ and use with different encodings. * * "Hello".swapcase #=> "hELLO" * "cYbEr_PuNk11".swapcase #=> "CyBeR_pUnK11"