>What about making an store_transcode( string, encodingtype ) function >which >takes a string, and stores the encodingtype version in it. Strings would >then be able to store multiple versions of themselves, in utf32, utf8, >etc >format. The original format would still be remembered as the 'main' >format, >of course, for all printing and so on. But for internal parrot string >ops, >one could use these alternate representations to avoid re-transcoding >strings. I had thought of this as well in order to reduce the number of conversions needed. However, parrot really doesn't know if 1 or 100 comparsions with unicode strings will be needed. Therefore, I thought it might be better if the Perl compiler did that optimization and created two string variables, one for the string native and one for the string unicode. Naturally, it would only have to create one string if it was only ever used one way, but either way it would be responsible for handling optimizations due to encoding difficulties. TantonThread Previous | Thread Next