Hello,
Is there a way to convert endian of a string (from little to big and vice versa) ?
Thanks,
Ido

Mailing lists / fpc-pascal / 2012-11
6 messages · 3 people ·
Reply by email Subscribe to this list Your subscription
Read-only archive. Use j and k to move between messages.
Hello,
Is there a way to convert endian of a string (from little to big and vice versa) ?
Thanks,
Ido
2012/11/26 ik
What kind of string you want to convert? For example a PChar is trivial.
Vincent
Is there a way to convert endian of a string (from little to big and vice versa) ? Ido
nik wroteHello, Is there a way to convert endian of a string (from little to big and vice versa) ?
Change the endianness of a string with what representation?
2012/11/26 ik What kind of string you want to convert? For example a PChar is trivial.…
ShortString, AnsiString, UTF8String, WideString and UnicodeString :)
If I understand things correctly: ShortString, AnsiString and UTF8String don't convert since they're simply byte sequences. As a particular case, it's unwise to try to map multiple bytes from a UTFxString into a cardinal.
Converting WideString and UnicodeString is a fair question. Are you handling text files with multibyte encoding?
On Mon, Nov 26, 2012 at 10:29 AM, Vincent Snijders ShortString, AnsiString, UTF8String,…
Should ReverseString work just as well ? :)