Ticket #1791 (closed bug: fixed)
zero-length string loses encoding in .pbc
| Reported by: | pmichaud | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | core | Version: | 2.7.0 |
| Severity: | medium | Keywords: | |
| Cc: | chromatic | Language: | |
| Patch status: | Platform: |
Description
A zero-length utf8 string loses its encoding when saved in a .pbc file:
pmichaud@orange:~/parrot/trunk$ ./parrot_config revision
48985
pmichaud@orange:~/parrot/trunk$ cat z.pir
.sub 'main' :main
$S0 = utf8:unicode:""
$I0 = encoding $S0
$S1 = encodingname $I0
say $S1
.end
pmichaud@orange:~/parrot/trunk$ ./parrot -o z.pbc z.pir
pmichaud@orange:~/parrot/trunk$ ./parrot z.pir
utf8
pmichaud@orange:~/parrot/trunk$ ./parrot z.pbc
ascii
pmichaud@orange:~/parrot/trunk$
This makes a difference for functions that make use of string encoding directly; for example, Rakudo passes C<utf8:unicode:""> to the C<get_string_as> method of ByteBuffer to request a unicode string (but is getting an ascii string when invoked from a .pbc).
Pm
Change History
Note: See
TracTickets for help on using
tickets.
