In our previous episode, Michael Schnell said: > > Moreover, will operations that use character access make sense at all > > if you don't know what the actual encoding is? > The administrative record of each "New Delphi string" contains the > encoding type and the byte-count for each code. So "you" (the compiler > and the RTL) do know it.
Yes, but the point is that the programmer that writes the index into the delete() might not oversee all cases. (codepaths that can bring a string to the current point). Keeping in mind that these functions generally work at the encoding granularity level. So something that works with unicode (utf16) will fail with ansi (utf8) if it contains values that utf8 can't encode in one byte. > - If using any statically encoded type for same, it is close to > impossible to create decently fast programs for string manipulation > (unless they by chance use the correct encoding type), as > auto-conversion to and fro is invisibly introduced. Well, the trick is not to leave that to chance. _______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal