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
Trying to output something unrepresentable in the encoding throws X::AdHoc #5969
Comments
From @briandfoyTrying to output a character unrepresentable in the specified my $file = 'encoding_test.txt'; spurt $path, 'İstanbul', enc => 'iso-8859-1'; CATCH { Here'e the error: Caught X::AdHoc: Error encoding Latin-1 string: could not encode |
From @skidsOn Mon, 02 Jan 2017 16:35:46 -0800, comdog wrote:
FWIW, not all encoding has to do with IO, and there is an X::Encoding This particular error occurs in the VM (at least on rakudo-m). Currently I'd say it's better to wait for that Moar work, or a decision not to do In certain cases we can immediately catch exceptions from the VM I only mention that because it is a way we could keep the code that I played a bit with that but it looks like trying to change the perl6 -e 'use nqp; sub f { "dh°".encode("ascii"); CATCH { when X::AdHoc { my \xp = nqp::getattr($_, Exception, "\$\!ex"); nqp::setmessage(xp, nqp::decont("foo")); nqp::setpayload(xp, nqp::decont(X::NYI.new())); $_.rethrow } } }; f(); CATCH { ":: {$_.perl} { my \xp = nqp::getattr($_, Exception, "\$\!ex"); my \xpp = nqp::getpayload(xp); xpp.^name } ::".say }' ...that would have required some further alterations to EXCEPTION to detect Or maybe it did work and EXCEPTION undid it... |
The RT System itself - Status changed from 'new' to 'open' |
Migrated from rt.perl.org#130488 (status was 'open')
Searchable as RT130488$
The text was updated successfully, but these errors were encountered: