Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[perl #38733] [TODO] Support utf8 as an input IO filter

0 views
Skip to first unread message

Will Coleda

unread,
Mar 15, 2006, 3:56:00 PM3/15/06
to bugs-bi...@rt.perl.org
# New Ticket Created by Will Coleda
# Please include the string: [perl #38733]
# in the subject line of all future correspondence about this issue.
# <URL: https://rt.perl.org/rt3/Ticket/Display.html?id=38733 >


In an effort to get APL working, I first have to be able to read an
APL program into memory, which means unicode operators.

As I'm modifying ponie, I end up with something like:

.sub _slurp_file
.param string filename
.local pmc filehandle
filehandle = open filename, "<"
push filehandle, 'utf8'
unless filehandle goto err_no_file
$S1 = read filehandle, 65535
close filehandle
$I99 = charset $S1
$S99 = charsetname $I99
print "source is "
print $S1
print "\n"
print "charset of source is: "
print $S99
print "\n"
.return ($S1)
.end

This compiles, prints out what looks like the right source code
(which at the moment is neither punie nor APL: "print 2²10;")

But the charset that's listed is ascii. I need to be able to read in
the utf8 encoded file and have it recognized as such by parrot.

It would also be helpful to have badly-specified IO filters generate
an exception. (utf8 doesn't appear to since it's supported for
*output*. using "monkeys" as the filter generates the slightly more
helpful: 'Layer not found').

Will Coleda

unread,
Mar 15, 2006, 4:09:31 PM3/15/06
to perl6-i...@perl.org, bugs-bi...@netlabs.develooper.com

On Mar 15, 2006, at 3:56 PM, Will Coleda (via RT) wrote:
>
> This compiles, prints out what looks like the right source code
> (which at the moment is neither punie nor APL: "print 2²10;")


I hate unicode. That is 'print 2 <LESS-THAN OR EQUAL TO> 10;'


0 new messages