On 04/08/2011 02:32 AM, Doriano Blengino wrote: > Kevin Fishburne ha scritto: >> >> Ahh, I understand a little better. I don't know much about endianness, >> so please excuse my ignorance here. When reading socket data into a >> string how is the data affected exactly? I can think of a few possibilities: >> >> 1) The byte order of the entire string is reversed ("abcd" becomes "dcba") >> 2) The bit order of the entire string is reversed (00001111 becomes >> 11110000) >> 3) The byte order of the values is reversed (0000 1111, 1010 1100 >> becomes 1111 0000, 1100 1010) >> 4) The bit order of the values is reversed(0000 1111, 1010 1100 becomes >> 1111 0000, 0011 0101) >> > Endiannes refers to the order the bytes are kept in memory, when a > numerical multi-byte value is involved. Strictly speaking, strings are > not affected. For example, human beings are big endian: the number 10, > composed by two digits, is written with the weighter digit first. If > human beings were little endian, they wrote this number as "01". > > ...
That is very good info, thank. So if endianness generally describes the byte order, not the bit order, then either each value (two, four or eight bytes) is reversed or the entire string is reversed. Hopefully it's the former rather than the latter, as that would be easier to compensate for. While it would be slow, I could just write functions for flipping the byte order of characters in a string. That would work fine for the client but may impact performance server side. I'll do some experimenting tomorrow to see what I can come up with. -- Kevin Fishburne Eight Virtues www: http://sales.eightvirtues.com e-mail: sa...@eightvirtues.com phone: (770) 853-6271 ------------------------------------------------------------------------------ Xperia(TM) PLAY It's a major breakthrough. An authentic gaming smartphone on the nation's most reliable network. And it wants your games. http://p.sf.net/sfu/verizon-sfdev _______________________________________________ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user