You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucy.apache.org by nw...@apache.org on 2013/09/28 19:33:02 UTC

[lucy-commits] [02/11] git commit: refs/heads/cfish-string-prep1 - Rename SSTR_WRAP_STR to SSTR_WRAP_UTF8

Rename SSTR_WRAP_STR to SSTR_WRAP_UTF8


Project: http://git-wip-us.apache.org/repos/asf/lucy/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy/commit/3f96ac16
Tree: http://git-wip-us.apache.org/repos/asf/lucy/tree/3f96ac16
Diff: http://git-wip-us.apache.org/repos/asf/lucy/diff/3f96ac16

Branch: refs/heads/cfish-string-prep1
Commit: 3f96ac161e7a4c649e969a8f49939b973df95cdc
Parents: 49cf696
Author: Nick Wellnhofer <we...@aevum.de>
Authored: Sat Sep 28 16:14:42 2013 +0200
Committer: Nick Wellnhofer <we...@aevum.de>
Committed: Sat Sep 28 16:14:42 2013 +0200

----------------------------------------------------------------------
 c/src/Lucy/Index/DocReader.c                    |  2 +-
 clownfish/compiler/src/CFCPerlTypeMap.c         |  2 +-
 clownfish/compiler/src/CFCRuby.c                |  2 +-
 clownfish/runtime/core/Clownfish/Hash.c         |  6 +-
 clownfish/runtime/core/Clownfish/String.cfh     |  6 +-
 .../runtime/core/Clownfish/Test/TestHash.c      | 12 ++--
 clownfish/runtime/core/Clownfish/Test/TestObj.c |  2 +-
 .../runtime/core/Clownfish/Test/TestVArray.c    |  2 +-
 clownfish/runtime/core/Clownfish/VTable.c       |  2 +-
 .../perl/buildlib/Clownfish/Build/Binding.pm    |  2 +-
 clownfish/runtime/perl/xs/XSBind.c              |  2 +-
 core/Lucy/Index/FilePurger.c                    |  2 +-
 core/Lucy/Index/IndexManager.c                  | 12 ++--
 core/Lucy/Index/PolyReader.c                    |  2 +-
 core/Lucy/Index/Segment.c                       |  2 +-
 core/Lucy/Plan/Schema.c                         |  2 +-
 core/Lucy/Store/CompoundFileReader.c            |  8 +--
 core/Lucy/Store/CompoundFileWriter.c            | 12 ++--
 core/Lucy/Store/FSFolder.c                      |  2 +-
 core/Lucy/Store/Lock.c                          |  2 +-
 core/Lucy/Store/SharedLock.c                    |  4 +-
 core/Lucy/Test/Analysis/TestNormalizer.c        |  4 +-
 core/Lucy/Test/Analysis/TestPolyAnalyzer.c      |  6 +-
 core/Lucy/Test/Analysis/TestRegexTokenizer.c    |  4 +-
 core/Lucy/Test/Analysis/TestSnowballStemmer.c   |  4 +-
 core/Lucy/Test/Analysis/TestStandardTokenizer.c |  2 +-
 core/Lucy/Test/Highlight/TestHighlighter.c      | 60 ++++++++++----------
 core/Lucy/Test/Index/TestSegment.c              | 10 ++--
 core/Lucy/Test/Index/TestSnapshot.c             | 12 ++--
 core/Lucy/Test/Plan/TestFieldType.c             |  6 +-
 core/Lucy/Test/Plan/TestFullTextType.c          |  4 +-
 core/Lucy/Test/Search/TestQueryParserLogic.c    |  4 +-
 core/Lucy/Test/Search/TestSortSpec.c            |  2 +-
 core/Lucy/Test/Store/TestFSDirHandle.c          |  8 +--
 core/Lucy/Test/Store/TestFSFileHandle.c         |  8 +--
 core/Lucy/Test/Store/TestFSFolder.c             | 18 +++---
 core/Lucy/Test/Store/TestFileHandle.c           |  4 +-
 core/Lucy/Test/Store/TestInStream.c             |  4 +-
 core/Lucy/Test/Store/TestRAMDirHandle.c         |  6 +-
 core/Lucy/Test/TestSchema.c                     |  4 +-
 core/Lucy/Test/TestUtils.c                      | 16 +++---
 core/Lucy/Test/Util/TestIndexFileNames.c        |  4 +-
 core/Lucy/Test/Util/TestJson.c                  |  8 +--
 core/Lucy/Util/Json.c                           |  2 +-
 perl/buildlib/Lucy/Build/Binding/Misc.pm        |  2 +-
 perl/xs/Lucy/Index/DocReader.c                  |  2 +-
 perl/xs/Lucy/Index/Inverter.c                   |  2 +-
 47 files changed, 147 insertions(+), 147 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy/blob/3f96ac16/c/src/Lucy/Index/DocReader.c
----------------------------------------------------------------------
diff --git a/c/src/Lucy/Index/DocReader.c b/c/src/Lucy/Index/DocReader.c
index 31a1077..ebd213c 100644
--- a/c/src/Lucy/Index/DocReader.c
+++ b/c/src/Lucy/Index/DocReader.c
@@ -67,7 +67,7 @@ DefDocReader_Fetch_Doc_IMP(DefaultDocReader *self, int32_t doc_id) {
 
         // Find the Field's FieldType.
         StackString *field_name_zcb
-            = SSTR_WRAP_STR(field_name, field_name_len);
+            = SSTR_WRAP_UTF8(field_name, field_name_len);
         type = Schema_Fetch_Type(schema, (String*)field_name_zcb);
 
         // Read the field value.

http://git-wip-us.apache.org/repos/asf/lucy/blob/3f96ac16/clownfish/compiler/src/CFCPerlTypeMap.c
----------------------------------------------------------------------
diff --git a/clownfish/compiler/src/CFCPerlTypeMap.c b/clownfish/compiler/src/CFCPerlTypeMap.c
index f568e15..6ce222f 100644
--- a/clownfish/compiler/src/CFCPerlTypeMap.c
+++ b/clownfish/compiler/src/CFCPerlTypeMap.c
@@ -234,7 +234,7 @@ static const char typemap_input[] =
     "    $var = (sizeof(UV) == 8) ? ($type)SvUV($arg) : ($type)SvNV($arg);\n"
     "\n"
     "CONST_CHARBUF\n"
-    "    $var = (const cfish_String*)CFISH_SSTR_WRAP_STR(SvPVutf8_nolen($arg), SvCUR($arg));\n"
+    "    $var = (const cfish_String*)CFISH_SSTR_WRAP_UTF8(SvPVutf8_nolen($arg), SvCUR($arg));\n"
     "\n";
 
 static const char typemap_output[] =

http://git-wip-us.apache.org/repos/asf/lucy/blob/3f96ac16/clownfish/compiler/src/CFCRuby.c
----------------------------------------------------------------------
diff --git a/clownfish/compiler/src/CFCRuby.c b/clownfish/compiler/src/CFCRuby.c
index b225fd9..b69b9d2 100644
--- a/clownfish/compiler/src/CFCRuby.c
+++ b/clownfish/compiler/src/CFCRuby.c
@@ -205,7 +205,7 @@ S_write_boot_c(CFCRuby *self) {
         "%s() {\n"
         "    %sbootstrap_parcel();\n"
         "\n"
-        "    cfish_StackString *alias = CFISH_SSTR_WRAP_STR(\"\", 0);\n"
+        "    cfish_StackString *alias = CFISH_SSTR_WRAP_UTF8(\"\", 0);\n"
         "}\n"
         "\n"
         "%s\n"

http://git-wip-us.apache.org/repos/asf/lucy/blob/3f96ac16/clownfish/runtime/core/Clownfish/Hash.c
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/Hash.c b/clownfish/runtime/core/Clownfish/Hash.c
index 02e9794..fd78864 100644
--- a/clownfish/runtime/core/Clownfish/Hash.c
+++ b/clownfish/runtime/core/Clownfish/Hash.c
@@ -160,7 +160,7 @@ Hash_Store_IMP(Hash *self, Obj *key, Obj *value) {
 
 void
 Hash_Store_Utf8_IMP(Hash *self, const char *key, size_t key_len, Obj *value) {
-    StackString *key_buf = SSTR_WRAP_STR((char*)key, key_len);
+    StackString *key_buf = SSTR_WRAP_UTF8((char*)key, key_len);
     Hash_do_store(self, (Obj*)key_buf, value,
                   SStr_Hash_Sum(key_buf), false);
 }
@@ -174,7 +174,7 @@ Hash_Make_Key_IMP(Hash *self, Obj *key, int32_t hash_sum) {
 
 Obj*
 Hash_Fetch_Utf8_IMP(Hash *self, const char *key, size_t key_len) {
-    StackString *key_buf = SSTR_WRAP_STR(key, key_len);
+    StackString *key_buf = SSTR_WRAP_UTF8(key, key_len);
     return Hash_Fetch_IMP(self, (Obj*)key_buf);
 }
 
@@ -226,7 +226,7 @@ Hash_Delete_IMP(Hash *self, const Obj *key) {
 
 Obj*
 Hash_Delete_Utf8_IMP(Hash *self, const char *key, size_t key_len) {
-    StackString *key_buf = SSTR_WRAP_STR(key, key_len);
+    StackString *key_buf = SSTR_WRAP_UTF8(key, key_len);
     return Hash_Delete_IMP(self, (Obj*)key_buf);
 }
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/3f96ac16/clownfish/runtime/core/Clownfish/String.cfh
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/String.cfh b/clownfish/runtime/core/Clownfish/String.cfh
index c4ea6d5..b66bbf5 100644
--- a/clownfish/runtime/core/Clownfish/String.cfh
+++ b/clownfish/runtime/core/Clownfish/String.cfh
@@ -433,7 +433,7 @@ __C__
 #define CFISH_SSTR_WRAP(source) \
     cfish_SStr_wrap(cfish_alloca(cfish_SStr_size()), source)
 
-#define CFISH_SSTR_WRAP_STR(ptr, size) \
+#define CFISH_SSTR_WRAP_UTF8(ptr, size) \
     cfish_SStr_wrap_str(cfish_alloca(cfish_SStr_size()), ptr, size)
 
 #define CFISH_STRITER_DONE  -1
@@ -441,8 +441,8 @@ __C__
 #ifdef CFISH_USE_SHORT_NAMES
   #define SSTR_BLANK             CFISH_SSTR_BLANK
   #define SSTR_WRAP              CFISH_SSTR_WRAP
-  #define SSTR_WRAP_STR          CFISH_SSTR_WRAP_STR
-  #define STRITER_DONE          CFISH_STRITER_DONE
+  #define SSTR_WRAP_UTF8         CFISH_SSTR_WRAP_UTF8
+  #define STRITER_DONE           CFISH_STRITER_DONE
 #endif
 __END_C__
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/3f96ac16/clownfish/runtime/core/Clownfish/Test/TestHash.c
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/Test/TestHash.c b/clownfish/runtime/core/Clownfish/Test/TestHash.c
index cb93b2e..e5000c9 100644
--- a/clownfish/runtime/core/Clownfish/Test/TestHash.c
+++ b/clownfish/runtime/core/Clownfish/Test/TestHash.c
@@ -40,7 +40,7 @@ static void
 test_Equals(TestBatchRunner *runner) {
     Hash *hash  = Hash_new(0);
     Hash *other = Hash_new(0);
-    StackString *stuff = SSTR_WRAP_STR("stuff", 5);
+    StackString *stuff = SSTR_WRAP_UTF8("stuff", 5);
 
     TEST_TRUE(runner, Hash_Equals(hash, (Obj*)other),
               "Empty hashes are equal");
@@ -68,9 +68,9 @@ test_Store_and_Fetch(TestBatchRunner *runner) {
     const uint32_t starting_cap = Hash_Get_Capacity(hash);
     VArray        *expected     = VA_new(100);
     VArray        *got          = VA_new(100);
-    StackString *twenty       = SSTR_WRAP_STR("20", 2);
-    StackString *forty        = SSTR_WRAP_STR("40", 2);
-    StackString *foo          = SSTR_WRAP_STR("foo", 3);
+    StackString *twenty       = SSTR_WRAP_UTF8("20", 2);
+    StackString *forty        = SSTR_WRAP_UTF8("40", 2);
+    StackString *foo          = SSTR_WRAP_UTF8("foo", 3);
 
     for (int32_t i = 0; i < 100; i++) {
         String *str = Str_newf("%i32", i);
@@ -168,8 +168,8 @@ test_Keys_Values_Iter(TestBatchRunner *runner) {
     TEST_TRUE(runner, VA_Equals(values, (Obj*)expected), "Values from Iter");
 
     {
-        StackString *forty = SSTR_WRAP_STR("40", 2);
-        StackString *nope  = SSTR_WRAP_STR("nope", 4);
+        StackString *forty = SSTR_WRAP_UTF8("40", 2);
+        StackString *nope  = SSTR_WRAP_UTF8("nope", 4);
         Obj *key = Hash_Find_Key(hash, (Obj*)forty, SStr_Hash_Sum(forty));
         TEST_TRUE(runner, Obj_Equals(key, (Obj*)forty), "Find_Key");
         key = Hash_Find_Key(hash, (Obj*)nope, SStr_Hash_Sum(nope)),

http://git-wip-us.apache.org/repos/asf/lucy/blob/3f96ac16/clownfish/runtime/core/Clownfish/Test/TestObj.c
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/Test/TestObj.c b/clownfish/runtime/core/Clownfish/Test/TestObj.c
index 4466ef0..63e2bae 100644
--- a/clownfish/runtime/core/Clownfish/Test/TestObj.c
+++ b/clownfish/runtime/core/Clownfish/Test/TestObj.c
@@ -37,7 +37,7 @@ TestObj_new() {
 
 static Obj*
 S_new_testobj() {
-    StackString *klass = SSTR_WRAP_STR("TestObj", 7);
+    StackString *klass = SSTR_WRAP_UTF8("TestObj", 7);
     Obj *obj;
     VTable *vtable = VTable_fetch_vtable((String*)klass);
     if (!vtable) {

http://git-wip-us.apache.org/repos/asf/lucy/blob/3f96ac16/clownfish/runtime/core/Clownfish/Test/TestVArray.c
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/Test/TestVArray.c b/clownfish/runtime/core/Clownfish/Test/TestVArray.c
index 4aa9ccd..06c1590 100644
--- a/clownfish/runtime/core/Clownfish/Test/TestVArray.c
+++ b/clownfish/runtime/core/Clownfish/Test/TestVArray.c
@@ -41,7 +41,7 @@ static void
 test_Equals(TestBatchRunner *runner) {
     VArray *array = VA_new(0);
     VArray *other = VA_new(0);
-    StackString *stuff = SSTR_WRAP_STR("stuff", 5);
+    StackString *stuff = SSTR_WRAP_UTF8("stuff", 5);
 
     TEST_TRUE(runner, VA_Equals(array, (Obj*)other),
               "Empty arrays are equal");

http://git-wip-us.apache.org/repos/asf/lucy/blob/3f96ac16/clownfish/runtime/core/Clownfish/VTable.c
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/VTable.c b/clownfish/runtime/core/Clownfish/VTable.c
index 6596018..71c6800 100644
--- a/clownfish/runtime/core/Clownfish/VTable.c
+++ b/clownfish/runtime/core/Clownfish/VTable.c
@@ -367,7 +367,7 @@ VTable_add_alias_to_registry(VTable *vtable, const char *alias_ptr,
     if (VTable_registry == NULL) {
         VTable_init_registry();
     }
-    StackString *alias = SSTR_WRAP_STR(alias_ptr, alias_len);
+    StackString *alias = SSTR_WRAP_UTF8(alias_ptr, alias_len);
     if (LFReg_Fetch(VTable_registry, (Obj*)alias)) {
         return false;
     }

http://git-wip-us.apache.org/repos/asf/lucy/blob/3f96ac16/clownfish/runtime/perl/buildlib/Clownfish/Build/Binding.pm
----------------------------------------------------------------------
diff --git a/clownfish/runtime/perl/buildlib/Clownfish/Build/Binding.pm b/clownfish/runtime/perl/buildlib/Clownfish/Build/Binding.pm
index 7743525..494febe 100644
--- a/clownfish/runtime/perl/buildlib/Clownfish/Build/Binding.pm
+++ b/clownfish/runtime/perl/buildlib/Clownfish/Build/Binding.pm
@@ -577,7 +577,7 @@ CODE:
     CFISH_UNUSED_VAR(unused_sv);
     STRLEN size;
     char *ptr = SvPVutf8(class_name_sv, size);
-    cfish_StackString *class_name = CFISH_SSTR_WRAP_STR(ptr, size);
+    cfish_StackString *class_name = CFISH_SSTR_WRAP_UTF8(ptr, size);
     cfish_VTable *vtable
         = cfish_VTable_fetch_vtable((cfish_String*)class_name);
     RETVAL = vtable ? (SV*)CFISH_VTable_To_Host(vtable) : &PL_sv_undef;

http://git-wip-us.apache.org/repos/asf/lucy/blob/3f96ac16/clownfish/runtime/perl/xs/XSBind.c
----------------------------------------------------------------------
diff --git a/clownfish/runtime/perl/xs/XSBind.c b/clownfish/runtime/perl/xs/XSBind.c
index 755667a..d3a8e84 100644
--- a/clownfish/runtime/perl/xs/XSBind.c
+++ b/clownfish/runtime/perl/xs/XSBind.c
@@ -64,7 +64,7 @@ XSBind_new_blank_obj(SV *either_sv) {
         // Use the supplied class name string to find a VTable.
         STRLEN len;
         char *ptr = SvPVutf8(either_sv, len);
-        cfish_StackString *klass = CFISH_SSTR_WRAP_STR(ptr, len);
+        cfish_StackString *klass = CFISH_SSTR_WRAP_UTF8(ptr, len);
         vtable = cfish_VTable_singleton((cfish_String*)klass, NULL);
     }
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/3f96ac16/core/Lucy/Index/FilePurger.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Index/FilePurger.c b/core/Lucy/Index/FilePurger.c
index d61482e..bdb0999 100644
--- a/core/Lucy/Index/FilePurger.c
+++ b/core/Lucy/Index/FilePurger.c
@@ -155,7 +155,7 @@ S_zap_dead_merge(FilePurger *self, Hash *candidates) {
         if (cutoff) {
             String *cutoff_seg = Seg_num_to_name(Obj_To_I64(cutoff));
             if (Folder_Exists(ivars->folder, cutoff_seg)) {
-                StackString *merge_json = SSTR_WRAP_STR("merge.json", 10);
+                StackString *merge_json = SSTR_WRAP_UTF8("merge.json", 10);
                 DirHandle *dh = Folder_Open_Dir(ivars->folder, cutoff_seg);
 
                 if (!dh) {

http://git-wip-us.apache.org/repos/asf/lucy/blob/3f96ac16/core/Lucy/Index/IndexManager.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Index/IndexManager.c b/core/Lucy/Index/IndexManager.c
index b22e993..3a6442e 100644
--- a/core/Lucy/Index/IndexManager.c
+++ b/core/Lucy/Index/IndexManager.c
@@ -233,7 +233,7 @@ S_obtain_lock_factory(IndexManager *self) {
 Lock*
 IxManager_Make_Write_Lock_IMP(IndexManager *self) {
     IndexManagerIVARS *const ivars = IxManager_IVARS(self);
-    StackString *write_lock_name = SSTR_WRAP_STR("write", 5);
+    StackString *write_lock_name = SSTR_WRAP_UTF8("write", 5);
     LockFactory *lock_factory = S_obtain_lock_factory(self);
     return LockFact_Make_Lock(lock_factory, (String*)write_lock_name,
                               ivars->write_lock_timeout,
@@ -243,7 +243,7 @@ IxManager_Make_Write_Lock_IMP(IndexManager *self) {
 Lock*
 IxManager_Make_Deletion_Lock_IMP(IndexManager *self) {
     IndexManagerIVARS *const ivars = IxManager_IVARS(self);
-    StackString *lock_name = SSTR_WRAP_STR("deletion", 8);
+    StackString *lock_name = SSTR_WRAP_UTF8("deletion", 8);
     LockFactory *lock_factory = S_obtain_lock_factory(self);
     return LockFact_Make_Lock(lock_factory, (String*)lock_name,
                               ivars->deletion_lock_timeout,
@@ -253,7 +253,7 @@ IxManager_Make_Deletion_Lock_IMP(IndexManager *self) {
 Lock*
 IxManager_Make_Merge_Lock_IMP(IndexManager *self) {
     IndexManagerIVARS *const ivars = IxManager_IVARS(self);
-    StackString *merge_lock_name = SSTR_WRAP_STR("merge", 5);
+    StackString *merge_lock_name = SSTR_WRAP_UTF8("merge", 5);
     LockFactory *lock_factory = S_obtain_lock_factory(self);
     return LockFact_Make_Lock(lock_factory, (String*)merge_lock_name,
                               ivars->merge_lock_timeout,
@@ -263,7 +263,7 @@ IxManager_Make_Merge_Lock_IMP(IndexManager *self) {
 void
 IxManager_Write_Merge_Data_IMP(IndexManager *self, int64_t cutoff) {
     IndexManagerIVARS *const ivars = IxManager_IVARS(self);
-    StackString *merge_json = SSTR_WRAP_STR("merge.json", 10);
+    StackString *merge_json = SSTR_WRAP_UTF8("merge.json", 10);
     Hash *data = Hash_new(1);
     bool success;
     Hash_Store_Utf8(data, "cutoff", 6, (Obj*)Str_newf("%i64", cutoff));
@@ -277,7 +277,7 @@ IxManager_Write_Merge_Data_IMP(IndexManager *self, int64_t cutoff) {
 Hash*
 IxManager_Read_Merge_Data_IMP(IndexManager *self) {
     IndexManagerIVARS *const ivars = IxManager_IVARS(self);
-    StackString *merge_json = SSTR_WRAP_STR("merge.json", 10);
+    StackString *merge_json = SSTR_WRAP_UTF8("merge.json", 10);
     if (Folder_Exists(ivars->folder, (String*)merge_json)) {
         Hash *stuff
             = (Hash*)Json_slurp_json(ivars->folder, (String*)merge_json);
@@ -297,7 +297,7 @@ IxManager_Read_Merge_Data_IMP(IndexManager *self) {
 bool
 IxManager_Remove_Merge_Data_IMP(IndexManager *self) {
     IndexManagerIVARS *const ivars = IxManager_IVARS(self);
-    StackString *merge_json = SSTR_WRAP_STR("merge.json", 10);
+    StackString *merge_json = SSTR_WRAP_UTF8("merge.json", 10);
     return Folder_Delete(ivars->folder, (String*)merge_json) != 0;
 }
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/3f96ac16/core/Lucy/Index/PolyReader.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Index/PolyReader.c b/core/Lucy/Index/PolyReader.c
index 1dbc0b5..267a3e9 100644
--- a/core/Lucy/Index/PolyReader.c
+++ b/core/Lucy/Index/PolyReader.c
@@ -381,7 +381,7 @@ PolyReader_do_open(PolyReader *self, Obj *index, Snapshot *snapshot,
 
         // Testing only.
         if (PolyReader_race_condition_debug1) {
-            StackString *temp = SSTR_WRAP_STR("temp", 4);
+            StackString *temp = SSTR_WRAP_UTF8("temp", 4);
             if (Folder_Exists(folder, (String*)temp)) {
                 bool success = Folder_Rename(folder, (String*)temp,
                                                PolyReader_race_condition_debug1);

http://git-wip-us.apache.org/repos/asf/lucy/blob/3f96ac16/core/Lucy/Index/Segment.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Index/Segment.c b/core/Lucy/Index/Segment.c
index 50b4e8a..511b15a 100644
--- a/core/Lucy/Index/Segment.c
+++ b/core/Lucy/Index/Segment.c
@@ -211,7 +211,7 @@ Seg_Store_Metadata_IMP(Segment *self, const String *key, Obj *value) {
 void
 Seg_Store_Metadata_Utf8_IMP(Segment *self, const char *key, size_t key_len,
                             Obj *value) {
-    StackString *k = SSTR_WRAP_STR((char*)key, key_len);
+    StackString *k = SSTR_WRAP_UTF8((char*)key, key_len);
     Seg_Store_Metadata(self, (String*)k, value);
 }
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/3f96ac16/core/Lucy/Plan/Schema.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Plan/Schema.c b/core/Lucy/Plan/Schema.c
index 098a698..070d6ce 100644
--- a/core/Lucy/Plan/Schema.c
+++ b/core/Lucy/Plan/Schema.c
@@ -420,7 +420,7 @@ Schema_Eat_IMP(Schema *self, Schema *other) {
 void
 Schema_Write_IMP(Schema *self, Folder *folder, const String *filename) {
     Hash *dump = Schema_Dump(self);
-    StackString *schema_temp = SSTR_WRAP_STR("schema.temp", 11);
+    StackString *schema_temp = SSTR_WRAP_UTF8("schema.temp", 11);
     bool success;
     Folder_Delete(folder, (String*)schema_temp); // Just in case.
     Json_spew_json((Obj*)dump, folder, (String*)schema_temp);

http://git-wip-us.apache.org/repos/asf/lucy/blob/3f96ac16/core/Lucy/Store/CompoundFileReader.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Store/CompoundFileReader.c b/core/Lucy/Store/CompoundFileReader.c
index 86307c3..79ca64a 100644
--- a/core/Lucy/Store/CompoundFileReader.c
+++ b/core/Lucy/Store/CompoundFileReader.c
@@ -36,7 +36,7 @@ CFReader_open(Folder *folder) {
 CompoundFileReader*
 CFReader_do_open(CompoundFileReader *self, Folder *folder) {
     CompoundFileReaderIVARS *const ivars = CFReader_IVARS(self);
-    String *cfmeta_file = (String*)SSTR_WRAP_STR("cfmeta.json", 11);
+    String *cfmeta_file = (String*)SSTR_WRAP_UTF8("cfmeta.json", 11);
     Hash *metadata = (Hash*)Json_slurp_json((Folder*)folder, cfmeta_file);
     Err *error = NULL;
 
@@ -73,7 +73,7 @@ CFReader_do_open(CompoundFileReader *self, Folder *folder) {
     }
 
     // Open an instream which we'll clone over and over.
-    String *cf_file = (String*)SSTR_WRAP_STR("cf.dat", 6);
+    String *cf_file = (String*)SSTR_WRAP_UTF8("cf.dat", 6);
     ivars->instream = Folder_Open_In(folder, cf_file);
     if (!ivars->instream) {
         ERR_ADD_FRAME(Err_get_error());
@@ -167,11 +167,11 @@ CFReader_Local_Delete_IMP(CompoundFileReader *self, const String *name) {
         // Once the number of virtual files falls to 0, remove the compound
         // files.
         if (Hash_Get_Size(ivars->records) == 0) {
-            String *cf_file = (String*)SSTR_WRAP_STR("cf.dat", 6);
+            String *cf_file = (String*)SSTR_WRAP_UTF8("cf.dat", 6);
             if (!Folder_Delete(ivars->real_folder, cf_file)) {
                 return false;
             }
-            String *cfmeta_file = (String*)SSTR_WRAP_STR("cfmeta.json", 11);
+            String *cfmeta_file = (String*)SSTR_WRAP_UTF8("cfmeta.json", 11);
             if (!Folder_Delete(ivars->real_folder, cfmeta_file)) {
                 return false;
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/3f96ac16/core/Lucy/Store/CompoundFileWriter.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Store/CompoundFileWriter.c b/core/Lucy/Store/CompoundFileWriter.c
index 82e4178..d1f2938 100644
--- a/core/Lucy/Store/CompoundFileWriter.c
+++ b/core/Lucy/Store/CompoundFileWriter.c
@@ -59,7 +59,7 @@ CFWriter_Destroy_IMP(CompoundFileWriter *self) {
 void
 CFWriter_Consolidate_IMP(CompoundFileWriter *self) {
     CompoundFileWriterIVARS *const ivars = CFWriter_IVARS(self);
-    String *cfmeta_file = (String*)SSTR_WRAP_STR("cfmeta.json", 11);
+    String *cfmeta_file = (String*)SSTR_WRAP_UTF8("cfmeta.json", 11);
     if (Folder_Exists(ivars->folder, cfmeta_file)) {
         THROW(ERR, "Merge already performed for %o",
               Folder_Get_Path(ivars->folder));
@@ -75,8 +75,8 @@ S_clean_up_old_temp_files(CompoundFileWriter *self,
                           CompoundFileWriterIVARS *ivars) {
     UNUSED_VAR(self);
     Folder *folder      = ivars->folder;
-    String *cfmeta_temp = (String*)SSTR_WRAP_STR("cfmeta.json.temp", 16);
-    String *cf_file     = (String*)SSTR_WRAP_STR("cf.dat", 6);
+    String *cfmeta_temp = (String*)SSTR_WRAP_UTF8("cfmeta.json.temp", 16);
+    String *cf_file     = (String*)SSTR_WRAP_UTF8("cf.dat", 6);
 
     if (Folder_Exists(folder, cf_file)) {
         if (!Folder_Delete(folder, cf_file)) {
@@ -98,7 +98,7 @@ S_do_consolidate(CompoundFileWriter *self, CompoundFileWriterIVARS *ivars) {
     Hash      *sub_files    = Hash_new(0);
     VArray    *files        = Folder_List(folder, NULL);
     VArray    *merged       = VA_new(VA_Get_Size(files));
-    String    *cf_file      = (String*)SSTR_WRAP_STR("cf.dat", 6);
+    String    *cf_file      = (String*)SSTR_WRAP_UTF8("cf.dat", 6);
     OutStream *outstream    = Folder_Open_Out(folder, (String*)cf_file);
     bool       rename_success;
 
@@ -143,8 +143,8 @@ S_do_consolidate(CompoundFileWriter *self, CompoundFileWriterIVARS *ivars) {
     }
 
     // Write metadata to cfmeta file.
-    String *cfmeta_temp = (String*)SSTR_WRAP_STR("cfmeta.json.temp", 16);
-    String *cfmeta_file = (String*)SSTR_WRAP_STR("cfmeta.json", 11);
+    String *cfmeta_temp = (String*)SSTR_WRAP_UTF8("cfmeta.json.temp", 16);
+    String *cfmeta_file = (String*)SSTR_WRAP_UTF8("cfmeta.json", 11);
     Json_spew_json((Obj*)metadata, (Folder*)ivars->folder, cfmeta_temp);
     rename_success = Folder_Rename(ivars->folder, cfmeta_temp, cfmeta_file);
     if (!rename_success) { RETHROW(INCREF(Err_get_error())); }

http://git-wip-us.apache.org/repos/asf/lucy/blob/3f96ac16/core/Lucy/Store/FSFolder.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Store/FSFolder.c b/core/Lucy/Store/FSFolder.c
index 1550d73..b37fe6b 100644
--- a/core/Lucy/Store/FSFolder.c
+++ b/core/Lucy/Store/FSFolder.c
@@ -253,7 +253,7 @@ FSFolder_Local_Find_Folder_IMP(FSFolder *self, const String *name) {
         }
         // Try to open a CompoundFileReader. On failure, just use the
         // existing folder.
-        String *cfmeta_file = (String*)SSTR_WRAP_STR("cfmeta.json", 11);
+        String *cfmeta_file = (String*)SSTR_WRAP_UTF8("cfmeta.json", 11);
         if (Folder_Local_Exists(subfolder, cfmeta_file)) {
             CompoundFileReader *cf_reader = CFReader_open(subfolder);
             if (cf_reader) {

http://git-wip-us.apache.org/repos/asf/lucy/blob/3f96ac16/core/Lucy/Store/Lock.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Store/Lock.c b/core/Lucy/Store/Lock.c
index 907b16b..e95fa5f 100644
--- a/core/Lucy/Store/Lock.c
+++ b/core/Lucy/Store/Lock.c
@@ -148,7 +148,7 @@ LFLock_Request_IMP(LockFileLock *self) {
     }
 
     // Create the "locks" subdirectory if necessary.
-    String *lock_dir_name = (String*)SSTR_WRAP_STR("locks", 5);
+    String *lock_dir_name = (String*)SSTR_WRAP_UTF8("locks", 5);
     if (!Folder_Exists(ivars->folder, lock_dir_name)) {
         if (!Folder_MkDir(ivars->folder, lock_dir_name)) {
             Err *mkdir_err = (Err*)CERTIFY(Err_get_error(), ERR);

http://git-wip-us.apache.org/repos/asf/lucy/blob/3f96ac16/core/Lucy/Store/SharedLock.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Store/SharedLock.c b/core/Lucy/Store/SharedLock.c
index f89f6f0..1707254 100644
--- a/core/Lucy/Store/SharedLock.c
+++ b/core/Lucy/Store/SharedLock.c
@@ -99,7 +99,7 @@ void
 ShLock_Clear_Stale_IMP(SharedLock *self) {
     SharedLockIVARS *const ivars = ShLock_IVARS(self);
 
-    String *lock_dir_name = (String*)SSTR_WRAP_STR("locks", 5);
+    String *lock_dir_name = (String*)SSTR_WRAP_UTF8("locks", 5);
     if (!Folder_Find_Folder(ivars->folder, lock_dir_name)) {
         return;
     }
@@ -127,7 +127,7 @@ bool
 ShLock_Is_Locked_IMP(SharedLock *self) {
     SharedLockIVARS *const ivars = ShLock_IVARS(self);
 
-    String *lock_dir_name = (String*)SSTR_WRAP_STR("locks", 5);
+    String *lock_dir_name = (String*)SSTR_WRAP_UTF8("locks", 5);
     if (!Folder_Find_Folder(ivars->folder, lock_dir_name)) {
         return false;
     }

http://git-wip-us.apache.org/repos/asf/lucy/blob/3f96ac16/core/Lucy/Test/Analysis/TestNormalizer.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Analysis/TestNormalizer.c b/core/Lucy/Test/Analysis/TestNormalizer.c
index 9bea51c..578f2c3 100644
--- a/core/Lucy/Test/Analysis/TestNormalizer.c
+++ b/core/Lucy/Test/Analysis/TestNormalizer.c
@@ -38,8 +38,8 @@ static void
 test_Dump_Load_and_Equals(TestBatchRunner *runner) {
     Normalizer *normalizer[4];
 
-    String *NFC  = (String*)SSTR_WRAP_STR("NFC",  3);
-    String *NFKC = (String*)SSTR_WRAP_STR("NFKC", 4);
+    String *NFC  = (String*)SSTR_WRAP_UTF8("NFC",  3);
+    String *NFKC = (String*)SSTR_WRAP_UTF8("NFKC", 4);
 
     normalizer[0] = Normalizer_new(NFKC, true,  false);
     normalizer[1] = Normalizer_new(NFC,  true,  false);

http://git-wip-us.apache.org/repos/asf/lucy/blob/3f96ac16/core/Lucy/Test/Analysis/TestPolyAnalyzer.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Analysis/TestPolyAnalyzer.c b/core/Lucy/Test/Analysis/TestPolyAnalyzer.c
index 79f3b66..2602c80 100644
--- a/core/Lucy/Test/Analysis/TestPolyAnalyzer.c
+++ b/core/Lucy/Test/Analysis/TestPolyAnalyzer.c
@@ -43,8 +43,8 @@ test_Dump_Load_and_Equals(TestBatchRunner *runner) {
         return;
     }
 
-    String       *EN          = (String*)SSTR_WRAP_STR("en", 2);
-    String       *ES          = (String*)SSTR_WRAP_STR("es", 2);
+    String       *EN          = (String*)SSTR_WRAP_UTF8("en", 2);
+    String       *ES          = (String*)SSTR_WRAP_UTF8("es", 2);
     PolyAnalyzer *analyzer    = PolyAnalyzer_new(EN, NULL);
     PolyAnalyzer *other       = PolyAnalyzer_new(ES, NULL);
     Obj          *dump        = (Obj*)PolyAnalyzer_Dump(analyzer);
@@ -70,7 +70,7 @@ test_Dump_Load_and_Equals(TestBatchRunner *runner) {
 
 static void
 test_analysis(TestBatchRunner *runner) {
-    String             *EN          = (String*)SSTR_WRAP_STR("en", 2);
+    String             *EN          = (String*)SSTR_WRAP_UTF8("en", 2);
     String             *source_text = Str_newf("Eats, shoots and leaves.");
     Normalizer         *normalizer  = Normalizer_new(NULL, true, false);
     StandardTokenizer  *tokenizer   = StandardTokenizer_new();

http://git-wip-us.apache.org/repos/asf/lucy/blob/3f96ac16/core/Lucy/Test/Analysis/TestRegexTokenizer.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Analysis/TestRegexTokenizer.c b/core/Lucy/Test/Analysis/TestRegexTokenizer.c
index b0e41b0..84a333f 100644
--- a/core/Lucy/Test/Analysis/TestRegexTokenizer.c
+++ b/core/Lucy/Test/Analysis/TestRegexTokenizer.c
@@ -38,8 +38,8 @@ test_Dump_Load_and_Equals(TestBatchRunner *runner) {
         return;
     }
 
-    StackString *word_char_pattern  = SSTR_WRAP_STR("\\w+", 3);
-    StackString *whitespace_pattern = SSTR_WRAP_STR("\\S+", 3);
+    StackString *word_char_pattern  = SSTR_WRAP_UTF8("\\w+", 3);
+    StackString *whitespace_pattern = SSTR_WRAP_UTF8("\\S+", 3);
     RegexTokenizer *word_char_tokenizer
         = RegexTokenizer_new((String*)word_char_pattern);
     RegexTokenizer *whitespace_tokenizer

http://git-wip-us.apache.org/repos/asf/lucy/blob/3f96ac16/core/Lucy/Test/Analysis/TestSnowballStemmer.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Analysis/TestSnowballStemmer.c b/core/Lucy/Test/Analysis/TestSnowballStemmer.c
index 3e6a44d..7848ce2 100644
--- a/core/Lucy/Test/Analysis/TestSnowballStemmer.c
+++ b/core/Lucy/Test/Analysis/TestSnowballStemmer.c
@@ -33,8 +33,8 @@ TestSnowStemmer_new() {
 
 static void
 test_Dump_Load_and_Equals(TestBatchRunner *runner) {
-    String *EN = (String*)SSTR_WRAP_STR("en", 2);
-    String *ES = (String*)SSTR_WRAP_STR("es", 2);
+    String *EN = (String*)SSTR_WRAP_UTF8("en", 2);
+    String *ES = (String*)SSTR_WRAP_UTF8("es", 2);
     SnowballStemmer *stemmer = SnowStemmer_new(EN);
     SnowballStemmer *other   = SnowStemmer_new(ES);
     Obj *dump       = (Obj*)SnowStemmer_Dump(stemmer);

http://git-wip-us.apache.org/repos/asf/lucy/blob/3f96ac16/core/Lucy/Test/Analysis/TestStandardTokenizer.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Analysis/TestStandardTokenizer.c b/core/Lucy/Test/Analysis/TestStandardTokenizer.c
index ab5f36e..8a0ae3f 100644
--- a/core/Lucy/Test/Analysis/TestStandardTokenizer.c
+++ b/core/Lucy/Test/Analysis/TestStandardTokenizer.c
@@ -51,7 +51,7 @@ static void
 test_tokenizer(TestBatchRunner *runner) {
     StandardTokenizer *tokenizer = StandardTokenizer_new();
 
-    StackString *word = SSTR_WRAP_STR(
+    StackString *word = SSTR_WRAP_UTF8(
                               " ."
                               "tha\xCC\x82t's"
                               ":"

http://git-wip-us.apache.org/repos/asf/lucy/blob/3f96ac16/core/Lucy/Test/Highlight/TestHighlighter.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Highlight/TestHighlighter.c b/core/Lucy/Test/Highlight/TestHighlighter.c
index 706cd2a..8520c07 100644
--- a/core/Lucy/Test/Highlight/TestHighlighter.c
+++ b/core/Lucy/Test/Highlight/TestHighlighter.c
@@ -59,12 +59,12 @@ TestHighlighter_new() {
 
 static void
 test_Raw_Excerpt(TestBatchRunner *runner, Searcher *searcher, Obj *query) {
-    String *content = (String*)SSTR_WRAP_STR("content", 7);
+    String *content = (String*)SSTR_WRAP_UTF8("content", 7);
     Highlighter *highlighter = Highlighter_new(searcher, query, content, 6);
     int32_t top;
     String *raw_excerpt;
 
-    String *field_val = (String *)SSTR_WRAP_STR("Ook.  Urk.  Ick.  ", 18);
+    String *field_val = (String *)SSTR_WRAP_UTF8("Ook.  Urk.  Ick.  ", 18);
     VArray *spans = VA_new(1);
     VA_Push(spans, (Obj*)Span_new(0, 18, 1.0f));
     HeatMap *heat_map = HeatMap_new(spans, 133);
@@ -95,7 +95,7 @@ test_Raw_Excerpt(TestBatchRunner *runner, Searcher *searcher, Obj *query) {
     DECREF(raw_excerpt);
     DECREF(heat_map);
 
-    field_val = (String *)SSTR_WRAP_STR("Ook urk ick i.", 14);
+    field_val = (String *)SSTR_WRAP_UTF8("Ook urk ick i.", 14);
     spans     = VA_new(1);
     VA_Push(spans, (Obj*)Span_new(12, 1, 1.0f));
     heat_map = HeatMap_new(spans, 133);
@@ -111,7 +111,7 @@ test_Raw_Excerpt(TestBatchRunner *runner, Searcher *searcher, Obj *query) {
     DECREF(heat_map);
     DECREF(raw_excerpt);
 
-    field_val = (String *)SSTR_WRAP_STR("Urk.  Iz no good.", 17);
+    field_val = (String *)SSTR_WRAP_UTF8("Urk.  Iz no good.", 17);
     spans     = VA_new(1);
     VA_Push(spans, (Obj*)Span_new(6, 2, 1.0f));
     heat_map = HeatMap_new(spans, 133);
@@ -129,7 +129,7 @@ test_Raw_Excerpt(TestBatchRunner *runner, Searcher *searcher, Obj *query) {
 
     // Words longer than excerpt len
 
-    field_val = (String *)SSTR_WRAP_STR("abc/def/ghi/jkl/mno", 19);
+    field_val = (String *)SSTR_WRAP_UTF8("abc/def/ghi/jkl/mno", 19);
 
     spans = VA_new(1);
     VA_Push(spans, (Obj*)Span_new(0, 3, 1.0f));
@@ -160,13 +160,13 @@ test_Raw_Excerpt(TestBatchRunner *runner, Searcher *searcher, Obj *query) {
 
 static void
 test_Highlight_Excerpt(TestBatchRunner *runner, Searcher *searcher, Obj *query) {
-    String *content = (String*)SSTR_WRAP_STR("content", 7);
+    String *content = (String*)SSTR_WRAP_UTF8("content", 7);
     Highlighter *highlighter = Highlighter_new(searcher, query, content, 3);
     String *highlighted;
 
     VArray *spans = VA_new(1);
     VA_Push(spans, (Obj*)Span_new(2, 1, 0.0f));
-    String *raw_excerpt = (String *)SSTR_WRAP_STR("a b c", 5);
+    String *raw_excerpt = (String *)SSTR_WRAP_UTF8("a b c", 5);
     highlighted = Highlighter_Highlight_Excerpt(highlighter, spans,
                                                 raw_excerpt, 0);
     TEST_TRUE(runner,
@@ -178,7 +178,7 @@ test_Highlight_Excerpt(TestBatchRunner *runner, Searcher *searcher, Obj *query)
     spans = VA_new(2);
     VA_Push(spans, (Obj*)Span_new(0, 1, 1.0f));
     VA_Push(spans, (Obj*)Span_new(10, 10, 1.0f));
-    raw_excerpt = (String *)SSTR_WRAP_STR(PHI, 2);
+    raw_excerpt = (String *)SSTR_WRAP_UTF8(PHI, 2);
     highlighted = Highlighter_Highlight_Excerpt(highlighter, spans,
                                                 raw_excerpt, 0);
     TEST_TRUE(runner,
@@ -189,7 +189,7 @@ test_Highlight_Excerpt(TestBatchRunner *runner, Searcher *searcher, Obj *query)
 
     spans = VA_new(1);
     VA_Push(spans, (Obj*)Span_new(3, 1, 1.0f));
-    raw_excerpt = (String *)SSTR_WRAP_STR(PHI " " PHI " " PHI, 8);
+    raw_excerpt = (String *)SSTR_WRAP_UTF8(PHI " " PHI " " PHI, 8);
     highlighted = Highlighter_Highlight_Excerpt(highlighter, spans,
                                                 raw_excerpt, 1);
     TEST_TRUE(runner,
@@ -204,7 +204,7 @@ test_Highlight_Excerpt(TestBatchRunner *runner, Searcher *searcher, Obj *query)
     VA_Push(spans, (Obj*)Span_new(2,  4, 1.0f));
     VA_Push(spans, (Obj*)Span_new(8,  9, 1.0f));
     VA_Push(spans, (Obj*)Span_new(8,  4, 1.0f));
-    raw_excerpt = (String *)SSTR_WRAP_STR(PHI " Oook. Urk. Ick. " PHI, 21);
+    raw_excerpt = (String *)SSTR_WRAP_UTF8(PHI " Oook. Urk. Ick. " PHI, 21);
     highlighted = Highlighter_Highlight_Excerpt(highlighter, spans,
                                                 raw_excerpt, 0);
     TEST_TRUE(runner,
@@ -221,7 +221,7 @@ test_Highlight_Excerpt(TestBatchRunner *runner, Searcher *searcher, Obj *query)
 static void
 test_Create_Excerpt(TestBatchRunner *runner, Searcher *searcher, Obj *query,
                     Hits *hits) {
-    String *content = (String*)SSTR_WRAP_STR("content", 7);
+    String *content = (String*)SSTR_WRAP_UTF8("content", 7);
     Highlighter *highlighter = Highlighter_new(searcher, query, content, 200);
 
     HitDoc *hit = Hits_Next(hits);
@@ -233,9 +233,9 @@ test_Create_Excerpt(TestBatchRunner *runner, Searcher *searcher, Obj *query,
               "highlighter tagged phrase and single term");
     DECREF(excerpt);
 
-    String *pre_tag = (String*)SSTR_WRAP_STR("\x1B[1m", 4);
+    String *pre_tag = (String*)SSTR_WRAP_UTF8("\x1B[1m", 4);
     Highlighter_Set_Pre_Tag(highlighter, pre_tag);
-    String *post_tag = (String*)SSTR_WRAP_STR("\x1B[0m", 4);
+    String *post_tag = (String*)SSTR_WRAP_UTF8("\x1B[0m", 4);
     Highlighter_Set_Post_Tag(highlighter, post_tag);
     excerpt = Highlighter_Create_Excerpt(highlighter, hit);
     TEST_TRUE(runner,
@@ -255,7 +255,7 @@ test_Create_Excerpt(TestBatchRunner *runner, Searcher *searcher, Obj *query,
     DECREF(hit);
     DECREF(highlighter);
 
-    query = (Obj*)SSTR_WRAP_STR("x \"x y z\" AND b", 15);
+    query = (Obj*)SSTR_WRAP_UTF8("x \"x y z\" AND b", 15);
     hits = Searcher_Hits(searcher, query, 0, 10, NULL);
     highlighter = Highlighter_new(searcher, query, content, 200);
     hit = Hits_Next(hits);
@@ -270,7 +270,7 @@ test_Create_Excerpt(TestBatchRunner *runner, Searcher *searcher, Obj *query,
     DECREF(highlighter);
     DECREF(hits);
 
-    query = (Obj*)SSTR_WRAP_STR("blind", 5);
+    query = (Obj*)SSTR_WRAP_UTF8("blind", 5);
     hits = Searcher_Hits(searcher, query, 0, 10, NULL);
     highlighter = Highlighter_new(searcher, query, content, 200);
     hit = Hits_Next(hits);
@@ -283,7 +283,7 @@ test_Create_Excerpt(TestBatchRunner *runner, Searcher *searcher, Obj *query,
     DECREF(highlighter);
     DECREF(hits);
 
-    query = (Obj*)SSTR_WRAP_STR("why", 3);
+    query = (Obj*)SSTR_WRAP_UTF8("why", 3);
     hits = Searcher_Hits(searcher, query, 0, 10, NULL);
     highlighter = Highlighter_new(searcher, query, content, 200);
     hit = Hits_Next(hits);
@@ -296,7 +296,7 @@ test_Create_Excerpt(TestBatchRunner *runner, Searcher *searcher, Obj *query,
     DECREF(highlighter);
     DECREF(hits);
 
-    Obj *term = (Obj*)SSTR_WRAP_STR("x", 1);
+    Obj *term = (Obj*)SSTR_WRAP_UTF8("x", 1);
     query = (Obj*)TermQuery_new(content, term);
     hits = Searcher_Hits(searcher, query, 0, 10, NULL);
     hit = Hits_Next(hits);
@@ -307,7 +307,7 @@ test_Create_Excerpt(TestBatchRunner *runner, Searcher *searcher, Obj *query,
               "specify field highlights correct field...");
     DECREF(excerpt);
     DECREF(highlighter);
-    String *alt = (String*)SSTR_WRAP_STR("alt", 3);
+    String *alt = (String*)SSTR_WRAP_UTF8("alt", 3);
     highlighter = Highlighter_new(searcher, query, alt, 200);
     excerpt = Highlighter_Create_Excerpt(highlighter, hit);
     TEST_TRUE(runner,
@@ -329,9 +329,9 @@ test_highlighting(TestBatchRunner *runner) {
     FullTextType *dunked_type = FullTextType_new((Analyzer*)tokenizer);
     FullTextType_Set_Highlightable(dunked_type, true);
     FullTextType_Set_Boost(dunked_type, 0.1f);
-    String *content = (String*)SSTR_WRAP_STR("content", 7);
+    String *content = (String*)SSTR_WRAP_UTF8("content", 7);
     Schema_Spec_Field(schema, content, (FieldType*)plain_type);
-    String *alt = (String*)SSTR_WRAP_STR("alt", 3);
+    String *alt = (String*)SSTR_WRAP_UTF8("alt", 3);
     Schema_Spec_Field(schema, alt, (FieldType*)dunked_type);
     DECREF(plain_type);
     DECREF(dunked_type);
@@ -341,21 +341,21 @@ test_highlighting(TestBatchRunner *runner) {
     Indexer *indexer = Indexer_new(schema, (Obj*)folder, NULL, 0);
 
     Doc *doc = Doc_new(NULL, 0);
-    String *string = (String *)SSTR_WRAP_STR(TEST_STRING, TEST_STRING_LEN);
+    String *string = (String *)SSTR_WRAP_UTF8(TEST_STRING, TEST_STRING_LEN);
     Doc_Store(doc, content, (Obj*)string);
     Indexer_Add_Doc(indexer, doc, 1.0f);
     DECREF(doc);
 
     doc = Doc_new(NULL, 0);
-    string = (String *)SSTR_WRAP_STR("\"I see,\" said the blind man.", 28);
+    string = (String *)SSTR_WRAP_UTF8("\"I see,\" said the blind man.", 28);
     Doc_Store(doc, content, (Obj*)string);
     Indexer_Add_Doc(indexer, doc, 1.0f);
     DECREF(doc);
 
     doc = Doc_new(NULL, 0);
-    string = (String *)SSTR_WRAP_STR("x but not why or 2ee", 20);
+    string = (String *)SSTR_WRAP_UTF8("x but not why or 2ee", 20);
     Doc_Store(doc, content, (Obj*)string);
-    string = (String *)SSTR_WRAP_STR(TEST_STRING
+    string = (String *)SSTR_WRAP_UTF8(TEST_STRING
                                      " and extra stuff so it scores lower",
                                      TEST_STRING_LEN + 35);
     Doc_Store(doc, alt, (Obj*)string);
@@ -366,7 +366,7 @@ test_highlighting(TestBatchRunner *runner) {
     DECREF(indexer);
 
     Searcher *searcher = (Searcher*)IxSearcher_new((Obj*)folder);
-    Obj *query = (Obj*)SSTR_WRAP_STR("\"x y z\" AND " PHI, 14);
+    Obj *query = (Obj*)SSTR_WRAP_UTF8("\"x y z\" AND " PHI, 14);
     Hits *hits = Searcher_Hits(searcher, query, 0, 10, NULL);
 
     test_Raw_Excerpt(runner, searcher, query);
@@ -385,7 +385,7 @@ test_hl_selection(TestBatchRunner *runner) {
     StandardTokenizer *tokenizer = StandardTokenizer_new();
     FullTextType *plain_type = FullTextType_new((Analyzer*)tokenizer);
     FullTextType_Set_Highlightable(plain_type, true);
-    String *content = (String*)SSTR_WRAP_STR("content", 7);
+    String *content = (String*)SSTR_WRAP_UTF8("content", 7);
     Schema_Spec_Field(schema, content, (FieldType*)plain_type);
     DECREF(plain_type);
     DECREF(tokenizer);
@@ -408,7 +408,7 @@ test_hl_selection(TestBatchRunner *runner) {
         "bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla. "
         "bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla. ";
     Doc *doc = Doc_new(NULL, 0);
-    String *string = (String *)SSTR_WRAP_STR(test_string, strlen(test_string));
+    String *string = (String *)SSTR_WRAP_UTF8(test_string, strlen(test_string));
     Doc_Store(doc, content, (Obj*)string);
     Indexer_Add_Doc(indexer, doc, 1.0f);
     DECREF(doc);
@@ -417,13 +417,13 @@ test_hl_selection(TestBatchRunner *runner) {
     DECREF(indexer);
 
     Searcher *searcher = (Searcher*)IxSearcher_new((Obj*)folder);
-    Obj *query = (Obj*)SSTR_WRAP_STR("NNN MMM", 7);
+    Obj *query = (Obj*)SSTR_WRAP_UTF8("NNN MMM", 7);
     Highlighter *highlighter = Highlighter_new(searcher, query, content, 200);
     Hits *hits = Searcher_Hits(searcher, query, 0, 10, NULL);
     HitDoc *hit = Hits_Next(hits);
     String *excerpt = Highlighter_Create_Excerpt(highlighter, hit);
-    String *mmm = (String*)SSTR_WRAP_STR("MMM", 3);
-    String *nnn = (String*)SSTR_WRAP_STR("NNN", 3);
+    String *mmm = (String*)SSTR_WRAP_UTF8("MMM", 3);
+    String *nnn = (String*)SSTR_WRAP_UTF8("NNN", 3);
     TEST_TRUE(runner, Str_Find(excerpt, mmm) >= 0 || Str_Find(excerpt, nnn) >= 0,
               "Sentence boundary algo doesn't chop terms");
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/3f96ac16/core/Lucy/Test/Index/TestSegment.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Index/TestSegment.c b/core/Lucy/Test/Index/TestSegment.c
index e0e9b6b..17b2d67 100644
--- a/core/Lucy/Test/Index/TestSegment.c
+++ b/core/Lucy/Test/Index/TestSegment.c
@@ -32,9 +32,9 @@ TestSeg_new() {
 static void
 test_fields(TestBatchRunner *runner) {
     Segment *segment = Seg_new(1);
-    StackString *foo = SSTR_WRAP_STR("foo", 3);
-    StackString *bar = SSTR_WRAP_STR("bar", 3);
-    StackString *baz = SSTR_WRAP_STR("baz", 3);
+    StackString *foo = SSTR_WRAP_UTF8("foo", 3);
+    StackString *bar = SSTR_WRAP_UTF8("bar", 3);
+    StackString *baz = SSTR_WRAP_UTF8("baz", 3);
     int32_t field_num;
 
     field_num = Seg_Add_Field(segment, (String*)foo);
@@ -126,8 +126,8 @@ test_Write_File_and_Read_File(TestBatchRunner *runner) {
     Segment   *segment = Seg_new(100);
     Segment   *got     = Seg_new(100);
     String    *meta;
-    String    *flotsam = (String*)SSTR_WRAP_STR("flotsam", 7);
-    String    *jetsam  = (String*)SSTR_WRAP_STR("jetsam", 6);
+    String    *flotsam = (String*)SSTR_WRAP_UTF8("flotsam", 7);
+    String    *jetsam  = (String*)SSTR_WRAP_UTF8("jetsam", 6);
 
     Seg_Set_Count(segment, 111);
     Seg_Store_Metadata_Utf8(segment, "foo", 3, (Obj*)Str_newf("bar"));

http://git-wip-us.apache.org/repos/asf/lucy/blob/3f96ac16/core/Lucy/Test/Index/TestSnapshot.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Index/TestSnapshot.c b/core/Lucy/Test/Index/TestSnapshot.c
index 1367d87..4d98f56 100644
--- a/core/Lucy/Test/Index/TestSnapshot.c
+++ b/core/Lucy/Test/Index/TestSnapshot.c
@@ -31,8 +31,8 @@ TestSnapshot_new() {
 static void
 test_Add_and_Delete(TestBatchRunner *runner) {
     Snapshot *snapshot = Snapshot_new();
-    String *foo = (String*)SSTR_WRAP_STR("foo", 3);
-    String *bar = (String*)SSTR_WRAP_STR("bar", 3);
+    String *foo = (String*)SSTR_WRAP_UTF8("foo", 3);
+    String *bar = (String*)SSTR_WRAP_UTF8("bar", 3);
 
     Snapshot_Add_Entry(snapshot, foo);
     Snapshot_Add_Entry(snapshot, foo); // redundant
@@ -55,8 +55,8 @@ static void
 test_path_handling(TestBatchRunner *runner) {
     Snapshot *snapshot = Snapshot_new();
     Folder   *folder   = (Folder*)RAMFolder_new(NULL);
-    String   *snap     = (String*)SSTR_WRAP_STR("snap", 4);
-    String   *crackle  = (String*)SSTR_WRAP_STR("crackle", 7);
+    String   *snap     = (String*)SSTR_WRAP_UTF8("snap", 4);
+    String   *crackle  = (String*)SSTR_WRAP_UTF8("crackle", 7);
 
     Snapshot_Write_File(snapshot, folder, snap);
     TEST_TRUE(runner, Str_Equals(snap, (Obj*)Snapshot_Get_Path(snapshot)),
@@ -79,8 +79,8 @@ static void
 test_Read_File_and_Write_File(TestBatchRunner *runner) {
     Snapshot *snapshot = Snapshot_new();
     Folder   *folder   = (Folder*)RAMFolder_new(NULL);
-    String   *snap     = (String*)SSTR_WRAP_STR("snap", 4);
-    String   *foo      = (String*)SSTR_WRAP_STR("foo", 3);
+    String   *snap     = (String*)SSTR_WRAP_UTF8("snap", 4);
+    String   *foo      = (String*)SSTR_WRAP_UTF8("foo", 3);
 
     Snapshot_Add_Entry(snapshot, foo);
     Snapshot_Write_File(snapshot, folder, snap);

http://git-wip-us.apache.org/repos/asf/lucy/blob/3f96ac16/core/Lucy/Test/Plan/TestFieldType.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Plan/TestFieldType.c b/core/Lucy/Test/Plan/TestFieldType.c
index 4cb87f2..c0a9acc 100644
--- a/core/Lucy/Test/Plan/TestFieldType.c
+++ b/core/Lucy/Test/Plan/TestFieldType.c
@@ -37,7 +37,7 @@ DummyFieldType_new() {
 
 static FieldType*
 S_alt_field_type() {
-    StackString *name = SSTR_WRAP_STR("DummyFieldType2", 15);
+    StackString *name = SSTR_WRAP_UTF8("DummyFieldType2", 15);
     VTable *vtable = VTable_singleton((String*)name, DUMMYFIELDTYPE);
     FieldType *self = (FieldType*)VTable_Make_Obj(vtable);
     return FType_init(self);
@@ -83,8 +83,8 @@ test_Dump_Load_and_Equals(TestBatchRunner *runner) {
 static void
 test_Compare_Values(TestBatchRunner *runner) {
     FieldType     *type = (FieldType*)DummyFieldType_new();
-    StackString *a    = SSTR_WRAP_STR("a", 1);
-    StackString *b    = SSTR_WRAP_STR("b", 1);
+    StackString *a    = SSTR_WRAP_UTF8("a", 1);
+    StackString *b    = SSTR_WRAP_UTF8("b", 1);
 
     TEST_TRUE(runner,
               FType_Compare_Values(type, (Obj*)a, (Obj*)b) < 0,

http://git-wip-us.apache.org/repos/asf/lucy/blob/3f96ac16/core/Lucy/Test/Plan/TestFullTextType.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Plan/TestFullTextType.c b/core/Lucy/Test/Plan/TestFullTextType.c
index 243dd69..06f11e8 100644
--- a/core/Lucy/Test/Plan/TestFullTextType.c
+++ b/core/Lucy/Test/Plan/TestFullTextType.c
@@ -88,8 +88,8 @@ static void
 test_Compare_Values(TestBatchRunner *runner) {
     StandardTokenizer *tokenizer = StandardTokenizer_new();
     FullTextType      *type      = FullTextType_new((Analyzer*)tokenizer);
-    StackString       *a         = SSTR_WRAP_STR("a", 1);
-    StackString       *b         = SSTR_WRAP_STR("b", 1);
+    StackString       *a         = SSTR_WRAP_UTF8("a", 1);
+    StackString       *b         = SSTR_WRAP_UTF8("b", 1);
 
     TEST_TRUE(runner,
               FullTextType_Compare_Values(type, (Obj*)a, (Obj*)b) < 0,

http://git-wip-us.apache.org/repos/asf/lucy/blob/3f96ac16/core/Lucy/Test/Search/TestQueryParserLogic.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Search/TestQueryParserLogic.c b/core/Lucy/Test/Search/TestQueryParserLogic.c
index 902c257..9eb89e9 100644
--- a/core/Lucy/Test/Search/TestQueryParserLogic.c
+++ b/core/Lucy/Test/Search/TestQueryParserLogic.c
@@ -864,7 +864,7 @@ S_create_index() {
     Indexer    *indexer = Indexer_new(schema, (Obj*)folder, NULL, 0);
     uint32_t i, max;
 
-    String *field = (String*)SSTR_WRAP_STR("content", 7);
+    String *field = (String*)SSTR_WRAP_UTF8("content", 7);
     for (i = 0, max = VA_Get_Size(doc_set); i < max; i++) {
         Doc *doc = Doc_new(NULL, 0);
         Doc_Store(doc, field, VA_Fetch(doc_set, i));
@@ -890,7 +890,7 @@ TestQPLogic_Run_IMP(TestQueryParserLogic *self, TestBatchRunner *runner) {
     IndexSearcher *searcher   = IxSearcher_new((Obj*)folder);
     QueryParser   *or_parser  = QParser_new(IxSearcher_Get_Schema(searcher),
                                             NULL, NULL, NULL);
-    StackString *AND        = SSTR_WRAP_STR("AND", 3);
+    StackString *AND        = SSTR_WRAP_UTF8("AND", 3);
     QueryParser   *and_parser = QParser_new(IxSearcher_Get_Schema(searcher),
                                             NULL, (String*)AND, NULL);
     QParser_Set_Heed_Colons(or_parser, true);

http://git-wip-us.apache.org/repos/asf/lucy/blob/3f96ac16/core/Lucy/Test/Search/TestSortSpec.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Search/TestSortSpec.c b/core/Lucy/Test/Search/TestSortSpec.c
index 81effa3..5a08230 100644
--- a/core/Lucy/Test/Search/TestSortSpec.c
+++ b/core/Lucy/Test/Search/TestSortSpec.c
@@ -429,7 +429,7 @@ test_sort_spec(TestBatchRunner *runner) {
     for (int i = 0; i < 100; ++i) {
         char name_buf[3];
         sprintf(name_buf, "%02d", nums[i]);
-        StackString *name = SSTR_WRAP_STR(name_buf, 2);
+        StackString *name = SSTR_WRAP_UTF8(name_buf, 2);
         S_add_doc(indexer, (Obj*)name, num_str, NULL);
         if (i % 10 == 0) {
             S_refresh_indexer(&indexer, schema, folder);

http://git-wip-us.apache.org/repos/asf/lucy/blob/3f96ac16/core/Lucy/Test/Store/TestFSDirHandle.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Store/TestFSDirHandle.c b/core/Lucy/Test/Store/TestFSDirHandle.c
index c6020bb..4a6cdfc 100644
--- a/core/Lucy/Test/Store/TestFSDirHandle.c
+++ b/core/Lucy/Test/Store/TestFSDirHandle.c
@@ -41,10 +41,10 @@ TestFSDH_new() {
 
 static void
 test_all(TestBatchRunner *runner) {
-    String   *foo           = (String*)SSTR_WRAP_STR("foo", 3);
-    String   *boffo         = (String*)SSTR_WRAP_STR("boffo", 5);
-    String   *foo_boffo     = (String*)SSTR_WRAP_STR("foo/boffo", 9);
-    String   *test_dir      = (String*)SSTR_WRAP_STR("_fsdir_test", 11);
+    String   *foo           = (String*)SSTR_WRAP_UTF8("foo", 3);
+    String   *boffo         = (String*)SSTR_WRAP_UTF8("boffo", 5);
+    String   *foo_boffo     = (String*)SSTR_WRAP_UTF8("foo/boffo", 9);
+    String   *test_dir      = (String*)SSTR_WRAP_UTF8("_fsdir_test", 11);
     FSFolder *folder        = FSFolder_new(test_dir);
     bool      saw_foo       = false;
     bool      saw_boffo     = false;

http://git-wip-us.apache.org/repos/asf/lucy/blob/3f96ac16/core/Lucy/Test/Store/TestFSFileHandle.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Store/TestFSFileHandle.c b/core/Lucy/Test/Store/TestFSFileHandle.c
index f1f78fb..5fba321 100644
--- a/core/Lucy/Test/Store/TestFSFileHandle.c
+++ b/core/Lucy/Test/Store/TestFSFileHandle.c
@@ -42,7 +42,7 @@ static void
 test_open(TestBatchRunner *runner) {
 
     FSFileHandle *fh;
-    String *test_filename = (String*)SSTR_WRAP_STR("_fstest", 7);
+    String *test_filename = (String*)SSTR_WRAP_UTF8("_fstest", 7);
 
     remove(Str_Get_Ptr8(test_filename));
 
@@ -108,7 +108,7 @@ test_Read_Write(TestBatchRunner *runner) {
     const char *bar = "bar";
     char buffer[12];
     char *buf = buffer;
-    String *test_filename = (String*)SSTR_WRAP_STR("_fstest", 7);
+    String *test_filename = (String*)SSTR_WRAP_UTF8("_fstest", 7);
 
     remove(Str_Get_Ptr8(test_filename));
     fh = FSFH_open(test_filename,
@@ -162,7 +162,7 @@ test_Read_Write(TestBatchRunner *runner) {
 
 static void
 test_Close(TestBatchRunner *runner) {
-    String *test_filename = (String*)SSTR_WRAP_STR("_fstest", 7);
+    String *test_filename = (String*)SSTR_WRAP_UTF8("_fstest", 7);
     FSFileHandle *fh;
 
     remove(Str_Get_Ptr8(test_filename));
@@ -200,7 +200,7 @@ test_Close(TestBatchRunner *runner) {
 
 static void
 test_Window(TestBatchRunner *runner) {
-    String *test_filename = (String*)SSTR_WRAP_STR("_fstest", 7);
+    String *test_filename = (String*)SSTR_WRAP_UTF8("_fstest", 7);
     FSFileHandle *fh;
     FileWindow *window = FileWindow_new();
     FileWindowIVARS *const window_ivars = FileWindow_IVARS(window);

http://git-wip-us.apache.org/repos/asf/lucy/blob/3f96ac16/core/Lucy/Test/Store/TestFSFolder.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Store/TestFSFolder.c b/core/Lucy/Test/Store/TestFSFolder.c
index 689bfa0..d661549 100644
--- a/core/Lucy/Test/Store/TestFSFolder.c
+++ b/core/Lucy/Test/Store/TestFSFolder.c
@@ -57,7 +57,7 @@ TestFSFolder_new() {
 static Folder*
 S_set_up() {
     rmdir("_fstest");
-    String   *test_dir = (String*)SSTR_WRAP_STR("_fstest", 7);
+    String   *test_dir = (String*)SSTR_WRAP_UTF8("_fstest", 7);
     FSFolder *folder = FSFolder_new(test_dir);
     FSFolder_Initialize(folder);
     if (!FSFolder_Check(folder)) {
@@ -79,7 +79,7 @@ S_tear_down() {
 static void
 test_Initialize_and_Check(TestBatchRunner *runner) {
     rmdir("_fstest");
-    String   *test_dir = (String*)SSTR_WRAP_STR("_fstest", 7);
+    String   *test_dir = (String*)SSTR_WRAP_UTF8("_fstest", 7);
     FSFolder *folder   = FSFolder_new(test_dir);
     TEST_FALSE(runner, FSFolder_Check(folder),
                "Check() returns false when folder dir doesn't exist");
@@ -95,9 +95,9 @@ static void
 test_protect_symlinks(TestBatchRunner *runner) {
 #ifdef ENABLE_SYMLINK_TESTS
     FSFolder *folder    = (FSFolder*)S_set_up();
-    String   *foo       = (String*)SSTR_WRAP_STR("foo", 3);
-    String   *bar       = (String*)SSTR_WRAP_STR("bar", 3);
-    String   *foo_boffo = (String*)SSTR_WRAP_STR("foo/boffo", 9);
+    String   *foo       = (String*)SSTR_WRAP_UTF8("foo", 3);
+    String   *bar       = (String*)SSTR_WRAP_UTF8("bar", 3);
+    String   *foo_boffo = (String*)SSTR_WRAP_UTF8("foo/boffo", 9);
 
     FSFolder_MkDir(folder, foo);
     FSFolder_MkDir(folder, bar);
@@ -152,14 +152,14 @@ void
 test_disallow_updir(TestBatchRunner *runner) {
     FSFolder *outer_folder = (FSFolder*)S_set_up();
 
-    String *foo = (String*)SSTR_WRAP_STR("foo", 3);
-    String *bar = (String*)SSTR_WRAP_STR("bar", 3);
+    String *foo = (String*)SSTR_WRAP_UTF8("foo", 3);
+    String *bar = (String*)SSTR_WRAP_UTF8("bar", 3);
     FSFolder_MkDir(outer_folder, foo);
     FSFolder_MkDir(outer_folder, bar);
 
-    String *inner_path = (String*)SSTR_WRAP_STR("_fstest/foo", 11);
+    String *inner_path = (String*)SSTR_WRAP_UTF8("_fstest/foo", 11);
     FSFolder *foo_folder = FSFolder_new(inner_path);
-    String *up_bar = (String*)SSTR_WRAP_STR("../bar", 6);
+    String *up_bar = (String*)SSTR_WRAP_UTF8("../bar", 6);
     TEST_FALSE(runner, FSFolder_Exists(foo_folder, up_bar),
                "up-dirs are inaccessible.");
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/3f96ac16/core/Lucy/Test/Store/TestFileHandle.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Store/TestFileHandle.c b/core/Lucy/Test/Store/TestFileHandle.c
index 4942d35..d624ff5 100644
--- a/core/Lucy/Test/Store/TestFileHandle.c
+++ b/core/Lucy/Test/Store/TestFileHandle.c
@@ -38,7 +38,7 @@ S_no_op_method(const void *vself) {
 
 static FileHandle*
 S_new_filehandle() {
-    StackString *klass = SSTR_WRAP_STR("TestFileHandle", 14);
+    StackString *klass = SSTR_WRAP_UTF8("TestFileHandle", 14);
     FileHandle *fh;
     VTable *vtable = VTable_fetch_vtable((String*)klass);
     if (!vtable) {
@@ -54,7 +54,7 @@ TestFH_Run_IMP(TestFileHandle *self, TestBatchRunner *runner) {
     TestBatchRunner_Plan(runner, (TestBatch*)self, 2);
 
     FileHandle    *fh    = S_new_filehandle();
-    StackString *foo   = SSTR_WRAP_STR("foo", 3);
+    StackString *foo   = SSTR_WRAP_UTF8("foo", 3);
 
     TEST_TRUE(runner, Str_Equals_Utf8(FH_Get_Path(fh), "", 0), "Get_Path");
     FH_Set_Path(fh, (String*)foo);

http://git-wip-us.apache.org/repos/asf/lucy/blob/3f96ac16/core/Lucy/Test/Store/TestInStream.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Store/TestInStream.c b/core/Lucy/Test/Store/TestInStream.c
index 1b7a941..471e472 100644
--- a/core/Lucy/Test/Store/TestInStream.c
+++ b/core/Lucy/Test/Store/TestInStream.c
@@ -96,8 +96,8 @@ test_refill(TestBatchRunner *runner) {
 
 static void
 test_Clone_and_Reopen(TestBatchRunner *runner) {
-    StackString *foo       = SSTR_WRAP_STR("foo", 3);
-    StackString *bar       = SSTR_WRAP_STR("bar", 3);
+    StackString *foo       = SSTR_WRAP_UTF8("foo", 3);
+    StackString *bar       = SSTR_WRAP_UTF8("bar", 3);
     RAMFile       *file      = RAMFile_new(NULL, false);
     OutStream     *outstream = OutStream_open((Obj*)file);
     RAMFileHandle *fh;

http://git-wip-us.apache.org/repos/asf/lucy/blob/3f96ac16/core/Lucy/Test/Store/TestRAMDirHandle.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Store/TestRAMDirHandle.c b/core/Lucy/Test/Store/TestRAMDirHandle.c
index d584630..ad6f92a 100644
--- a/core/Lucy/Test/Store/TestRAMDirHandle.c
+++ b/core/Lucy/Test/Store/TestRAMDirHandle.c
@@ -33,9 +33,9 @@ TestRAMDH_new() {
 static void
 test_all(TestBatchRunner *runner) {
     RAMFolder *folder        = RAMFolder_new(NULL);
-    String    *foo           = (String*)SSTR_WRAP_STR("foo", 3);
-    String    *boffo         = (String*)SSTR_WRAP_STR("boffo", 5);
-    String    *foo_boffo     = (String*)SSTR_WRAP_STR("foo/boffo", 9);
+    String    *foo           = (String*)SSTR_WRAP_UTF8("foo", 3);
+    String    *boffo         = (String*)SSTR_WRAP_UTF8("boffo", 5);
+    String    *foo_boffo     = (String*)SSTR_WRAP_UTF8("foo/boffo", 9);
     bool       saw_foo       = false;
     bool       saw_boffo     = false;
     bool       foo_was_dir   = false;

http://git-wip-us.apache.org/repos/asf/lucy/blob/3f96ac16/core/Lucy/Test/TestSchema.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/TestSchema.c b/core/Lucy/Test/TestSchema.c
index ec40329..7983c9b 100644
--- a/core/Lucy/Test/TestSchema.c
+++ b/core/Lucy/Test/TestSchema.c
@@ -42,7 +42,7 @@ TestSchema_init(TestSchema *self, bool use_alt_arch) {
 
     Schema_init((Schema*)self);
     FullTextType_Set_Highlightable(type, true);
-    String *content = (String*)SSTR_WRAP_STR("content", 7);
+    String *content = (String*)SSTR_WRAP_UTF8("content", 7);
     TestSchema_Spec_Field(self, content, (FieldType*)type);
     DECREF(type);
     DECREF(tokenizer);
@@ -70,7 +70,7 @@ test_Equals(TestBatchRunner *runner) {
     TestSchema *schema = TestSchema_new(false);
     TestSchema *arch_differs = TestSchema_new(true);
     TestSchema *spec_differs = TestSchema_new(false);
-    String     *content      = (String*)SSTR_WRAP_STR("content", 7);
+    String     *content      = (String*)SSTR_WRAP_UTF8("content", 7);
     FullTextType *type = (FullTextType*)TestSchema_Fetch_Type(spec_differs,
                                                               content);
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/3f96ac16/core/Lucy/Test/TestUtils.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/TestUtils.c b/core/Lucy/Test/TestUtils.c
index 38576a6..a6bf118 100644
--- a/core/Lucy/Test/TestUtils.c
+++ b/core/Lucy/Test/TestUtils.c
@@ -76,14 +76,14 @@ TestUtils_make_poly_query(uint32_t boolop, ...) {
 
 TermQuery*
 TestUtils_make_term_query(const char *field, const char *term) {
-    String *field_str = (String*)SSTR_WRAP_STR(field, strlen(field));
-    String *term_str  = (String*)SSTR_WRAP_STR(term, strlen(term));
+    String *field_str = (String*)SSTR_WRAP_UTF8(field, strlen(field));
+    String *term_str  = (String*)SSTR_WRAP_UTF8(term, strlen(term));
     return TermQuery_new((String*)field_str, (Obj*)term_str);
 }
 
 PhraseQuery*
 TestUtils_make_phrase_query(const char *field, ...) {
-    String *field_str = (String*)SSTR_WRAP_STR(field, strlen(field));
+    String *field_str = (String*)SSTR_WRAP_UTF8(field, strlen(field));
     va_list args;
     VArray *terms = VA_new(0);
     PhraseQuery *query;
@@ -102,9 +102,9 @@ TestUtils_make_phrase_query(const char *field, ...) {
 
 LeafQuery*
 TestUtils_make_leaf_query(const char *field, const char *term) {
-    String *term_str  = (String*)SSTR_WRAP_STR(term, strlen(term));
+    String *term_str  = (String*)SSTR_WRAP_UTF8(term, strlen(term));
     String *field_str = field
-                       ? (String*)SSTR_WRAP_STR(field, strlen(field))
+                       ? (String*)SSTR_WRAP_UTF8(field, strlen(field))
                        : NULL;
     return LeafQuery_new(field_str, term_str);
 }
@@ -120,9 +120,9 @@ RangeQuery*
 TestUtils_make_range_query(const char *field, const char *lower_term,
                            const char *upper_term, bool include_lower,
                            bool include_upper) {
-    String *f     = (String*)SSTR_WRAP_STR(field, strlen(field));
-    String *lterm = (String*)SSTR_WRAP_STR(lower_term, strlen(lower_term));
-    String *uterm = (String*)SSTR_WRAP_STR(upper_term, strlen(upper_term));
+    String *f     = (String*)SSTR_WRAP_UTF8(field, strlen(field));
+    String *lterm = (String*)SSTR_WRAP_UTF8(lower_term, strlen(lower_term));
+    String *uterm = (String*)SSTR_WRAP_UTF8(upper_term, strlen(upper_term));
     return RangeQuery_new(f, (Obj*)lterm, (Obj*)uterm, include_lower,
                           include_upper);
 }

http://git-wip-us.apache.org/repos/asf/lucy/blob/3f96ac16/core/Lucy/Test/Util/TestIndexFileNames.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Util/TestIndexFileNames.c b/core/Lucy/Test/Util/TestIndexFileNames.c
index c5b2a18..5e51db8 100644
--- a/core/Lucy/Test/Util/TestIndexFileNames.c
+++ b/core/Lucy/Test/Util/TestIndexFileNames.c
@@ -30,7 +30,7 @@ TestIxFileNames_new() {
 static void
 S_test_local_part(TestBatchRunner *runner, const char *source,
                   const char *wanted, const char *test_name) {
-    StackString *source_str = SSTR_WRAP_STR(source, strlen(source));
+    StackString *source_str = SSTR_WRAP_UTF8(source, strlen(source));
     String *got = IxFileNames_local_part((String*)source_str);
     TEST_TRUE(runner, Str_Equals_Utf8(got, wanted, strlen(wanted)), test_name);
     DECREF(got);
@@ -51,7 +51,7 @@ test_local_part(TestBatchRunner *runner) {
 static void
 S_test_extract_gen(TestBatchRunner *runner, const char *name, uint64_t gen,
                    const char *test_name) {
-    StackString *source = SSTR_WRAP_STR(name, strlen(name));
+    StackString *source = SSTR_WRAP_UTF8(name, strlen(name));
     TEST_TRUE(runner, IxFileNames_extract_gen((String*)source) == gen,
               test_name);
 }

http://git-wip-us.apache.org/repos/asf/lucy/blob/3f96ac16/core/Lucy/Test/Util/TestJson.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Util/TestJson.c b/core/Lucy/Test/Util/TestJson.c
index 2fa7e32..367b0e3 100644
--- a/core/Lucy/Test/Util/TestJson.c
+++ b/core/Lucy/Test/Util/TestJson.c
@@ -201,7 +201,7 @@ test_spew_and_slurp(TestBatchRunner *runner) {
     Obj *dump = S_make_dump();
     Folder *folder = (Folder*)RAMFolder_new(NULL);
 
-    String *foo = (String*)SSTR_WRAP_STR("foo", 3);
+    String *foo = (String*)SSTR_WRAP_UTF8("foo", 3);
     bool result = Json_spew_json(dump, folder, foo);
     TEST_TRUE(runner, result, "spew_json returns true on success");
     TEST_TRUE(runner, Folder_Exists(folder, foo),
@@ -219,14 +219,14 @@ test_spew_and_slurp(TestBatchRunner *runner) {
               "Failed spew_json sets Err_error");
 
     Err_set_error(NULL);
-    String *bar = (String*)SSTR_WRAP_STR("bar", 3);
+    String *bar = (String*)SSTR_WRAP_UTF8("bar", 3);
     got = Json_slurp_json(folder, bar);
     TEST_TRUE(runner, got == NULL,
               "slurp_json returns NULL when file doesn't exist");
     TEST_TRUE(runner, Err_get_error() != NULL,
               "Failed slurp_json sets Err_error");
 
-    String *boffo = (String*)SSTR_WRAP_STR("boffo", 5);
+    String *boffo = (String*)SSTR_WRAP_UTF8("boffo", 5);
 
     FileHandle *fh
         = Folder_Open_FileHandle(folder, boffo, FH_CREATE | FH_WRITE_ONLY);
@@ -247,7 +247,7 @@ test_spew_and_slurp(TestBatchRunner *runner) {
 
 static void
 S_verify_bad_syntax(TestBatchRunner *runner, const char *bad, const char *mess) {
-    StackString *has_errors = SSTR_WRAP_STR(bad, strlen(bad));
+    StackString *has_errors = SSTR_WRAP_UTF8(bad, strlen(bad));
     Err_set_error(NULL);
     Obj *not_json = Json_from_json((String*)has_errors);
     TEST_TRUE(runner, not_json == NULL, "from_json returns NULL: %s", mess);

http://git-wip-us.apache.org/repos/asf/lucy/blob/3f96ac16/core/Lucy/Util/Json.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Util/Json.c b/core/Lucy/Util/Json.c
index cdb01fb..c96a69d 100644
--- a/core/Lucy/Util/Json.c
+++ b/core/Lucy/Util/Json.c
@@ -687,7 +687,7 @@ S_set_error(CharBuf *buf, const char *json, const char *limit, int line,
         const char *end = StrHelp_back_utf8_char(json + 32, json);
         len = end - json;
     }
-    StackString *snippet = SSTR_WRAP_STR(json, len);
+    StackString *snippet = SSTR_WRAP_UTF8(json, len);
     S_append_json_string((String*)snippet, buf);
 
     String *mess = CB_Yield_String(buf);

http://git-wip-us.apache.org/repos/asf/lucy/blob/3f96ac16/perl/buildlib/Lucy/Build/Binding/Misc.pm
----------------------------------------------------------------------
diff --git a/perl/buildlib/Lucy/Build/Binding/Misc.pm b/perl/buildlib/Lucy/Build/Binding/Misc.pm
index 6f082bc..09dc616 100644
--- a/perl/buildlib/Lucy/Build/Binding/Misc.pm
+++ b/perl/buildlib/Lucy/Build/Binding/Misc.pm
@@ -141,7 +141,7 @@ PPCODE:
 {
     char *class_name = HvNAME(SvSTASH(SvRV(blank_obj)));
     cfish_StackString *klass
-        = CFISH_SSTR_WRAP_STR(class_name, strlen(class_name));
+        = CFISH_SSTR_WRAP_UTF8(class_name, strlen(class_name));
     cfish_VTable *vtable
         = (cfish_VTable*)cfish_VTable_singleton((cfish_String*)klass, NULL);
     STRLEN len;

http://git-wip-us.apache.org/repos/asf/lucy/blob/3f96ac16/perl/xs/Lucy/Index/DocReader.c
----------------------------------------------------------------------
diff --git a/perl/xs/Lucy/Index/DocReader.c b/perl/xs/Lucy/Index/DocReader.c
index 15eafe1..29a0359 100644
--- a/perl/xs/Lucy/Index/DocReader.c
+++ b/perl/xs/Lucy/Index/DocReader.c
@@ -62,7 +62,7 @@ LUCY_DefDocReader_Fetch_Doc_IMP(lucy_DefaultDocReader *self, int32_t doc_id) {
 
         // Find the Field's FieldType.
         cfish_StackString *field_name_zcb
-            = CFISH_SSTR_WRAP_STR(field_name_ptr, field_name_len);
+            = CFISH_SSTR_WRAP_UTF8(field_name_ptr, field_name_len);
         type = LUCY_Schema_Fetch_Type(schema, (cfish_String*)field_name_zcb);
 
         // Read the field value.

http://git-wip-us.apache.org/repos/asf/lucy/blob/3f96ac16/perl/xs/Lucy/Index/Inverter.c
----------------------------------------------------------------------
diff --git a/perl/xs/Lucy/Index/Inverter.c b/perl/xs/Lucy/Index/Inverter.c
index 23eb9ab..4c3cd4e 100644
--- a/perl/xs/Lucy/Index/Inverter.c
+++ b/perl/xs/Lucy/Index/Inverter.c
@@ -50,7 +50,7 @@ S_fetch_entry(lucy_Inverter *self, HE *hash_entry) {
         }
     }
 
-    cfish_StackString *field = CFISH_SSTR_WRAP_STR(key, key_len);
+    cfish_StackString *field = CFISH_SSTR_WRAP_UTF8(key, key_len);
     int32_t field_num
         = LUCY_Seg_Field_Num(ivars->segment, (cfish_String*)field);
     if (!field_num) {