Fix (system base types) on big-endian systems.
authorMark H Weaver <mhw@netris.org>
Sat, 15 Mar 2014 17:23:21 +0000 (13:23 -0400)
committerMark H Weaver <mhw@netris.org>
Sat, 15 Mar 2014 17:23:21 +0000 (13:23 -0400)
* module/system/base/types.scm (cell->object): When reading stringbufs,
  use UTF-32BE on big-endian systems.

module/system/base/types.scm

index ed95347..4544a6b 100644 (file)
@@ -428,7 +428,9 @@ using BACKEND."
            (stringbuf (bytevector->string buf "ISO-8859-1")))
           (((_ & #x047f = (bitwise-ior #x400 %tc7-stringbuf))
             len (bytevector buf (* 4 len)))
-           (stringbuf (bytevector->string buf "UTF-32LE")))
+           (stringbuf (bytevector->string buf (match (native-endianness)
+                                                ('little "UTF-32LE")
+                                                ('big "UTF-32BE")))))
           (((_ & #x7f = %tc7-bytevector) len address)
            (let ((bv-port (memory-port backend address len)))
              (get-bytevector-all bv-port)))