-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rakudo silently loses information on .encode for non-representable characters #3654
Comments
From @moritz<moritz> m: say 'ö'.encode('ASCII') Since ö isn't representable as ASCII, this should throw an exception. Here is my wish list: 1) the default is to throw an exception, let's say X::Str::NotEncodable.new( 2) if a replacment is desired, indicate that through an adverb in the 'ö'.encode('ASCII', :replacement) to get the default, or 'ö'.encode('ASCII'. :replacement(Buf.new(42))) to be able to chose a replacement byte or byte sequence. If somebody implements it, I'll add it to the design docs :-) Cheers, |
From @jnthnOn Sun Jan 25 07:35:58 2015, moritz wrote:
The default is now to throw an exception (not typed for now), and the replacement functionality is available (though you specify it as a string, to ensure you can't replace with something that is bogus in the target encoding). ilmari++ for working on this; I'm just closing the ticket! Tests in S32-str/encode.t. /jnthn |
The RT System itself - Status changed from 'new' to 'open' |
@jnthn - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#123673 (status was 'resolved')
Searchable as RT123673$
The text was updated successfully, but these errors were encountered: