As to the floats (I figure those are the values tagged as "number"): I just tried it on a big-endian machine (Solaris/sparc, flashplayer 9.0.47.0), in addition to little-endian Linux/x86. The results:
Flashplayer apparently stores its cookies in the same format, independently of the architecture the player is running on1 (which confirms what GrandFather wrote). I.e., a hexdump of the buffer (unpack "H*", $buffer) in your _readFloat routine consistently shows the same pattern, e.g. 4049000000000000 for 50.0 (as found in the settings.sol file, which is being created by default the first time the player is started).
It seems you can properly decode those values using
unpack 'd', $buffer; # big-endian (e.g. sparc, PA-RISC) # i.e. 'perl -V' showing "byteorder=432 +1" unpack 'd', reverse $buffer; # little-endian (e.g. x86) # i.e. 'perl -V' showing "byteorder=123 +4"
However, I so far haven't been able to test this with "more complex" floats, i.e. not just simple ints (like 50) represented as floats — mainly because I couldn't find a site which would set such a value... but I suppose it would work. (Do you have a link to a site which will make my flashplayer store numbers such as 726.127318273?)
___
1 Adobe++ for this, BTW — as it does allow you to share your home directory (~/.macromedia/) across multiple architectures. (Early versions of Firefox got this wrong, for example, storing architecture-dependent stuff in your profile, which made the browser segfault when you switched from one platform to another... (now fixed) )
In reply to Re^3: Test and endianness
by almut
in thread Test and endianness
by andreas1234567
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |