<div dir="ltr">Thanks Juan, I'll take a closer look into the cause of my issues.</div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">On Thu, Jul 2, 2026 at 10:49 AM Juan Vuletich <<a href="mailto:juan@cuis.st">juan@cuis.st</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><u></u>

  
    
  
  <div>
    <p>And what you actually want is most likely
      #asUtf8BytesOrByteString, #asUtf8BytesOrByteStringOrByteArray to
      properly handle Unicode. That of course depends on whether the
      apis you're calling can handle UTF-8.</p>
    <p>Besides, 'abc' is an instance of String. You get a UnicodeString
      when you go beyond ASCII. Most apis prefer UTF-8 in that case.</p>
    <p>Cheers,</p>
    <div>On 2026-07-01 1:59 PM, Juan Vuletich
      via Cuis-dev wrote:<br>
    </div>
    <blockquote type="cite">
      
      <p>Well, that boat sailed a long time ago.</p>
      <p>The interoperability between (Byte)String and UnicodeString
        does exactly the same as interoperability between
        SmallInteger/LargeInteger/Fraction/Float. With numbers, this
        only matters when dealing with the external world, where you
        need to ensure you're using the required primitive type, and not
        what Smalltalk choses for you. Same here. #asByteString to the
        rescue.</p>
      <p>See
        <a href="https://github.com/Cuis-Smalltalk/Cuis-Smalltalk-Dev/blob/master/Documentation/Papers/2022-11-UnicodeSupportInCuisSmalltalk.pdf" target="_blank">https://github.com/Cuis-Smalltalk/Cuis-Smalltalk-Dev/blob/master/Documentation/Papers/2022-11-UnicodeSupportInCuisSmalltalk.pdf</a></p>
      <p>Hope this helps,</p>
      <div>On 2026-07-01 11:59 AM, Phil B via
        Cuis-dev wrote:<br>
      </div>
      <blockquote type="cite">
        
        <div dir="ltr">Sorry... forgot to reply all.
          <div><br>
          </div>
          <div>To put it more succinctly: rather than assume that
            anywhere you have a string/stream it's just as good to
            substitute a Unicode string/stream, it really seems like it
            should be opt-in via #asUnicodeString or #asUniFileStream
            for coercion or explicit at instance creation time.  That
            makes the contract clear and you don't get something other
            than what you want/need.</div>
        </div>
        <br>
        <div class="gmail_quote">
          <div dir="ltr" class="gmail_attr">On Wed, Jul 1, 2026 at
            11:52 AM Phil B <<a href="mailto:pbpublist@gmail.com" target="_blank">pbpublist@gmail.com</a>>
            wrote:<br>
          </div>
          <blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
            <div dir="ltr">I hear what you're saying but that assumption
              breaks a lot of code.  They are *similar* to String, but
              they are actually very different creatures and only
              superficially protocol compatible<span style="background-color:transparent">. (i.e. you often
                cannot substitute a UnicodeString for a String without
                severely breaking things... even when 'String' is
                nowhere in the source code that breaks)  I have had to
                ugly up a lot of code to get out of the implicit opt-in
                to Unicode that Cuis has done on this front.[1] Please
                don't rename String... that would make things 100x
                worse.</span>
              <div><span style="background-color:transparent"><br>
                </span></div>
              <div><span style="background-color:transparent">[1] </span><span style="background-color:transparent">i.e. 'where the
                  hell did that UnicodeString come from?' when I didn't
                  want it... usually when dealing with a DNU error
                  dialog.  Even when I resolve the DNU, the breakage
                  often continues on down the chain because you can't
                  just substitute UnicodeString for String when you're
                  dealing with FFI, web APIs, file formats etc.</span></div>
            </div>
            <br>
            <div class="gmail_quote">
              <div dir="ltr" class="gmail_attr">On Wed, Jul 1, 2026 at
                11:16 AM Juan Vuletich <<a href="mailto:juan@cuis.st" target="_blank">juan@cuis.st</a>>
                wrote:<br>
              </div>
              <blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi
                Phil,<br>
                <br>
                On 2026-07-01 10:27 AM, Phil B via Cuis-dev wrote:<br>
                > Is there a reason UnicodeString asString returns
                self rather than a <br>
                > String?<br>
                ><br>
                Yes. UnicodeStrings are conceptually Strings. Perhaps
                we'd rename String <br>
                as ByteString, and CharacterSequence as String.<br>
                <br>
                In any case, just use #asByteString that does what you
                want.<br>
                <br>
                Cheers,<br>
                <br>
                -- <br>
                Juan Vuletich<br>
                <a href="http://www.cuis.st" rel="noreferrer" target="_blank">www.cuis.st</a><br>
                <a href="http://github.com/jvuletich" rel="noreferrer" target="_blank">github.com/jvuletich</a><br>
                <a href="http://researchgate.net/profile/Juan-Vuletich" rel="noreferrer" target="_blank">researchgate.net/profile/Juan-Vuletich</a><br>
                <a href="http://independent.academia.edu/JuanVuletich" rel="noreferrer" target="_blank">independent.academia.edu/JuanVuletich</a><br>
                <a href="http://patents.justia.com/inventor/juan-manuel-vuletich" rel="noreferrer" target="_blank">patents.justia.com/inventor/juan-manuel-vuletich</a><br>
                <br>
              </blockquote>
            </div>
          </blockquote>
        </div>
        <br>
        <fieldset></fieldset>
      </blockquote>
      <pre cols="72">-- 
Juan Vuletich
<a href="http://www.cuis.st" target="_blank">www.cuis.st</a>
<a href="http://github.com/jvuletich" target="_blank">github.com/jvuletich</a>
<a href="http://researchgate.net/profile/Juan-Vuletich" target="_blank">researchgate.net/profile/Juan-Vuletich</a>
<a href="http://independent.academia.edu/JuanVuletich" target="_blank">independent.academia.edu/JuanVuletich</a>
<a href="http://patents.justia.com/inventor/juan-manuel-vuletich" target="_blank">patents.justia.com/inventor/juan-manuel-vuletich</a></pre>
      <br>
      <fieldset></fieldset>
    </blockquote>
    <pre cols="72">-- 
Juan Vuletich
<a href="http://www.cuis.st" target="_blank">www.cuis.st</a>
<a href="http://github.com/jvuletich" target="_blank">github.com/jvuletich</a>
<a href="http://researchgate.net/profile/Juan-Vuletich" target="_blank">researchgate.net/profile/Juan-Vuletich</a>
<a href="http://independent.academia.edu/JuanVuletich" target="_blank">independent.academia.edu/JuanVuletich</a>
<a href="http://patents.justia.com/inventor/juan-manuel-vuletich" target="_blank">patents.justia.com/inventor/juan-manuel-vuletich</a></pre>
  </div>

</blockquote></div>