about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2015-09-16 10:09:08 -0700
committerKartik K. Agaram <vc@akkartik.com>2015-09-16 10:09:16 -0700
commit064813d9b7d7ad4d13779a0e3282e00b747372e3 (patch)
treeb8f529453c55784ef49fbf15133387c59fef1895
parent5c6587d004afa038a57da9e9e30b2b8944ca0201 (diff)
downloadmu-064813d9b7d7ad4d13779a0e3282e00b747372e3.tar.gz
2204
-rw-r--r--043new.cc10
1 files changed, 8 insertions, 2 deletions
diff --git a/043new.cc b/043new.cc
index 817eee53..a99296f2 100644
--- a/043new.cc
+++ b/043new.cc
@@ -374,6 +374,13 @@ if (is_mu_string(r)) {
   return read_mu_string(data.at(0));
 }
 
+:(scenario unicode_string)
+recipe main [
+  x:address:array:character <- new [♠]
+  stash [foo:], x:address:array:character
+]
++app: foo: ♠
+
 //: Allocate more to routine when initializing a literal string
 :(scenario new_string_overflow)
 % Initial_memory_per_routine = 2;
@@ -410,8 +417,7 @@ string read_mu_string(long long int address) {
   if (size == 0) return "";
   ostringstream tmp;
   for (long long int curr = address+1; curr <= address+size; ++curr) {
-    // todo: unicode
-    tmp << (char)(int)Memory[curr];
+    tmp << to_unicode(static_cast<uint32_t>(Memory[curr]));
   }
   return tmp.str();
 }