Improving D's support of code-pages

Kirk McDonald kirklin.mcdonald at gmail.com
Mon Aug 20 00:49:01 PDT 2007


Leandro Lucarella wrote:
> Kirk McDonald, el 18 de agosto a las 14:33 me escribiste:
> 
>>char[] decode(ubyte[] str, string encoding, string error="strict");
>>wchar[] wdecode(ubyte[] str, string encoding, string error="strict");
>>dchar[] ddecode(ubyte[] str, string encoding, string error="strict");
> 
> 
> Why isn't error an enum instead of a string?
> 

Perhaps it would be useful to allow the user to define new 
error-handlers somehow, and provide a callback for them. (Python allows 
something like this.) This would allow you to, for instance, provide a 
different replacement character than the one provided by "replace".

-- 
Kirk McDonald
http://kirkmcdonald.blogspot.com
Pyd: Connecting D and Python
http://pyd.dsource.org



More information about the Digitalmars-d mailing list