aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/lux/data/text/encoding.lux
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--stdlib/source/lux/data/text/encoding.lux9
1 files changed, 7 insertions, 2 deletions
diff --git a/stdlib/source/lux/data/text/encoding.lux b/stdlib/source/lux/data/text/encoding.lux
index 4622c8be9..3296f78c4 100644
--- a/stdlib/source/lux/data/text/encoding.lux
+++ b/stdlib/source/lux/data/text/encoding.lux
@@ -204,7 +204,9 @@
(pack [Text] RubyString)))
@.php
- (as_is (host.import: (unpack [host.String host.String] Binary))
+ (as_is (host.import: Almost_Binary)
+ (host.import: (unpack [host.String host.String] Almost_Binary))
+ (host.import: (array_values [Almost_Binary] Binary))
(def: php_byte_array_format "C*"))}
(as_is)))
@@ -249,7 +251,10 @@
(RubyString::bytes []))
@.php
- (..unpack [..php_byte_array_format value])}))
+ (|> (..unpack [..php_byte_array_format value])
+ ..array_values
+ ("php object new" "ArrayObject")
+ (:coerce Binary))}))
(def: (utf8\decode value)
(-> Binary (Try Text))