# New Ticket Created by  "brian d foy" 
# Please include the string:  [perl #130486]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org/Ticket/Display.html?id=130486 >


I was playing with encodings for spurt. I wanted to output some
Turkish text, failed, and got an X::AdHoc exception. Should that be
X::IO, or maybe something else?

    my $file = 'encoding_test.txt';
    my $path = $*SPEC.catfile( $*SPEC.tmpdir, $file );

    put "path is $path";

    put "İstanbul is not Constantinople" if 'İstanbul' ne 'Constantinople';

    #spurt $path, 'İstanbul', enc => 'latin9';
    #spurt $path, 'İstanbul', enc => 'latin-9';
    spurt $path, 'İstanbul', enc => 'iso-8859-9';

    CATCH {
        put "Caught {.^name}: {.message}";
        }

I get:

    Caught X::AdHoc: Unknown string encoding: 'iso-8859-9'

I figured that the encoding wouldn't be found because it's not listed
in /src/core/Rakudo/Internals.pm in the $encodings associative even
though it looks like there is a passthrough as the last resort. I did
not suss out who actually throws this exception.

Reply via email to