summaryrefslogtreecommitdiff
path: root/module/system/base/types.scm
diff options
context:
space:
mode:
authorMark H Weaver <mhw@netris.org>2014-03-15 13:23:21 -0400
committerMark H Weaver <mhw@netris.org>2014-03-15 13:23:21 -0400
commitf2de4fac885cb2964429657ea45a686e22bb3c2c (patch)
tree64da390f547d34bdab36dbd0671a0fad811cfafa /module/system/base/types.scm
parent2b509a2e37f9d3f98a1c8051629a339f499c0193 (diff)
downloadguile-f2de4fac885cb2964429657ea45a686e22bb3c2c.tar.gz
Fix (system base types) on big-endian systems.
* module/system/base/types.scm (cell->object): When reading stringbufs, use UTF-32BE on big-endian systems.
Diffstat (limited to 'module/system/base/types.scm')
-rw-r--r--module/system/base/types.scm4
1 files changed, 3 insertions, 1 deletions
diff --git a/module/system/base/types.scm b/module/system/base/types.scm
index ed95347c4..4544a6ba0 100644
--- a/module/system/base/types.scm
+++ b/module/system/base/types.scm
@@ -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)))