#468: string encoding not saved in pbc
----------------------+-----------------------------------------------------
Reporter: NotFound | Owner:
Type: bug | Status: new
Priority: major | Milestone:
Component: core | Version:
Severity: medium | Keywords:
Lang: | Patch:
Platform: all |
----------------------+-----------------------------------------------------
Description changed by NotFound:
Old description:
> This example shows the problem caused by the unimplementation of the
> Encoding field of string constants in pbc files:
>
> {{{
> $ cat strings.pir
> .sub main
> $S0 = "hello"
> show($S0)
> $S0 = unicode:"hello"
> show($S0)
> $S0 = utf8:unicode:"hello"
> show($S0)
> $S0 = utf16:unicode:"hello"
> show($S0)
> $S0 = ucs2:unicode:"hello"
> show($S0)
> .end
>
> .sub show
> .param string s
> print s
> $I0 = bytelength s
> print '('
> print $I0
> print "): "
> $I0 = encoding s
> $S0 = encodingname $I0
> say $S0
> .end
>
> $ ./parrot strings.pir
> hello(5): fixed_8
> hello(5): utf8
> hello(5): utf8
> hello(5): utf16
> hello(5): ucs2
> $ ./parrot -o strings.pbc strings.pir
> hello(5): fixed_8
> hello(5): utf8
> hello(5): utf8
> hello(5): utf8
> hello(5): utf8
> }}}
>
> To adequately solve the problem and test it, the pir compilers must also
> be fixed.
New description:
This example shows the problem caused by the unimplementation of the
Encoding field of string constants in pbc files:
{{{
$ cat strings.pir
.sub main
$S0 = "hello"
show($S0)
$S0 = unicode:"hello"
show($S0)
$S0 = utf8:unicode:"hello"
show($S0)
$S0 = utf16:unicode:"hello"
show($S0)
$S0 = ucs2:unicode:"hello"
show($S0)
.end
.sub show
.param string s
print s
$I0 = bytelength s
print '('
print $I0
print "): "
$I0 = encoding s
$S0 = encodingname $I0
say $S0
.end
$ ./parrot strings.pir
hello(5): fixed_8
hello(5): utf8
hello(5): utf8
hello(5): utf16
hello(5): ucs2
$ ./parrot -o strings.pbc strings.pir
$ ./parrot strings.pbc
hello(5): fixed_8
hello(5): utf8
hello(5): utf8
hello(5): utf8
hello(5): utf8
}}}
To adequately solve the problem and test it, the pir compilers must also
be fixed.
--
--
Ticket URL: <https://trac.parrot.org/parrot/ticket/468#comment:1>
Parrot <https://trac.parrot.org/parrot/>
Parrot Development
_______________________________________________
parrot-tickets mailing list
[email protected]
http://lists.parrot.org/mailman/listinfo/parrot-tickets