Ticket #468 (new bug) — at Version 1

Opened 13 years ago

Last modified 11 years ago

string encoding not saved in pbc

Reported by: NotFound Owned by:
Priority: major Milestone:
Component: core Version:
Severity: medium Keywords:
Cc: Language:
Patch status: Platform: all

Description (last modified by NotFound) (diff)

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.

Change History

Changed 13 years ago by NotFound

  • description modified (diff)
Note: See TracTickets for help on using tickets.