Colin Paul Adams wrote:

Parrot_new_string

and I'm passing "UTF-8" as the encoding name.

I get back:

Can't make 'UTF-8' charset strings
                     ^^^^^^^

Despite what the documentation says:

encoding

Yeah. I'm sorry to say that: you are just hitting a part of Parrot labeled "under (re)construction" and the docs aren't all up to date.


If you are using vim, "make tags" [1] in the parrot directory, follow "string_make", which is called from Parrot_new_string() and you'll see a more but still not complete listing of *charset*s that are supplied currently. The ultimate list of charsets can be found in charset/*.c or src/charset.c.

Additionally the interface doc is talking about an encoding, which is pretty misleading:

  fixed_8 - iso_8859_xxx

  encoding - charset which one

You currently can just pass a charset, but the default encoding for the charset "unicode" is "utf8" (now).

This specifies the encoding used to encode the characters in the
data. There are currently four character encodings used in Parrot:
singlebyte, UTF-8, UTF-16 and UTF-32. UTF-16 and UTF-32 should use the
native endianness of the machine.

That is outdated and future as well. Currently only utf8 encoding is working (for some degree of working)


So does that mean I'm limited to singlebyte strings?

No, pass charset "unicode", which defaults to encoding "utf8"

leo

[1] patches for other editors very welcome



Reply via email to