[Issue 10717] std.ascii.toLower and toUpper should return char instead of dchar and avoid me to use a bad cast(char)

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Jul 26 05:17:51 PDT 2013


http://d.puremagic.com/issues/show_bug.cgi?id=10717


Jonathan M Davis <jmdavisProg at gmx.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jmdavisProg at gmx.com
           Severity|normal                      |enhancement


--- Comment #1 from Jonathan M Davis <jmdavisProg at gmx.com> 2013-07-26 05:17:49 PDT ---
I really don't think that this is a bug. By taking dchar, they work with ranges
of dchar and allow you to operate on strings that contain Unicode in cases
where all you care about are particular ASCII characters (like when you only
care about ASCII whitespace in a string - not Unicode whitespace - but the
string contains Unicode characters). And as soon the functions accept dchar,
they must return dchar, or they'll destroy any Unicode characters that get
passed in.

A reasonable enhancement request would be to overload these functions with
overloads which take char and return char, but there is actual value in having
them accept and return dchar, and it would break existing code if they stopped.
So, the functions that are there are there to stay, but you may get overloads
which operate specifically on char.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list