Need a string_unescape function returning c-string

kjstol parrotcode at gmail.com
Tue Jan 13 23:09:24 UTC 2009


On Tue, Jan 13, 2009 at 11:03 PM, Simon Cozens <simon at simon-cozens.org>wrote:

> kjstol wrote:
> > However, I (well, PIRC does) need a string unescape function (taking a
> > c-string) that returns a c-string.
> >
> > Can we add a function to string.c that does in fact just that
>
> "C strings" ought to be anathema in Parrot. When someone talks about a
> "C string" you should look at them as if they have just said a dirty word.
>
> Going from a STRING to "C string" means throwing away encoding and
> charset information, which means you are left with a string of bytes
> that mean ABSOLUTELY NOTHING. I think if we do implement such a function
> it should return the string transcoded into Double-Byte Character Set
> EBCDIC, just to make the point.
>
> No C strings, please.


thing is, I don't really mind where it is coded, but it already happens to
be in Parrot, kindof.
I can understand that it's not desired to PARROT_EXPORT a function as
described, and that's fine. However, that does mean I'll be duplicating
code.

PIRC absolutely needs this, and in that case it's absolutely safe to use, as
there is no encoding yet: I'm now converting the c-string into a STRING
(because that's what the unescaping function happens to return) , to then
convert it back into a c-string. Not useful. Not efficient.

kjs
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.parrot.org/pipermail/parrot-dev/attachments/20090113/65c02f3c/attachment.htm 


More information about the parrot-dev mailing list