in reply to Re^20: Interleaving bytes in a string quickly
in thread Interleaving bytes in a string quickly
...can silently encode your bytes using UTF-8.", .... Any encoding has to be done, explicitly, by the programmer.No, it doesn't.
Yes. It does!
I even gave an example.
No. You did not! And you still have not--given an example of encoding occuring "silently".
Perl does not assign meaning to the values inside the string*.
What is PV w/ UTF8=0 or a PV w/ UTF8=1., if it is not "Perl ... assigning a meaning"?
At the C-level, there is no difference; but at the Perl level there most definitely is. And it is at the C-level I am calling SvPVX(). For the very reason I do not want to make any such distinction. The same would not be true if I used SvPVBytes() as you suggested.
If you guarantee that you give a string in UTF8=0 format (say by calling utf8::downgrade before calling interleave) you won't have a problem.
You are still getting it arse backward. I don't need to call downgrade(), because I know I'm never going to call upgrade(), or anything else that might cause perl to assign any other meaning than bytes to my data.
That hadn't been specified until now.
Oh, but it has. Over and over:
Your games aren't fun.
I'm not playing games.. Far from it.
You asserted: "It can silently encode your bytes using UTF-8.". Since you have demonstrably more knowledge of unicode than I, despite my strong belief that this was impossible, I was unsure enough to ask: Okay. How could it "silently encode my bytes as utf"?. Because if it was true, I wanted to know how.
But, despite your protestations to the contrary above, you have still not provided an example of how this can happen. I now know this is because you cannot do so. Because it is impossible.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^22: Interleaving bytes in a string quickly
by ikegami (Patriarch) on Mar 01, 2010 at 13:57 UTC | |
by BrowserUk (Patriarch) on Mar 01, 2010 at 14:20 UTC | |
by ikegami (Patriarch) on Mar 01, 2010 at 14:50 UTC | |
by BrowserUk (Patriarch) on Mar 01, 2010 at 14:59 UTC | |
by ikegami (Patriarch) on Mar 01, 2010 at 15:13 UTC | |
| |
by BrowserUk (Patriarch) on Mar 01, 2010 at 16:43 UTC |