Uploaded image for project: 'Swift Driver'
  1. Swift Driver
  2. SWIFT-351

Correctly encode strings with multi-byte UTF8 characters

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.1.0
    • Component/s: None
    • Labels:

      Description

      All C driver methods that take in strings also take in an Int32 corresponding to the string's length.
      In all these cases, we use the String.count property to get the length.
      However, to handle multi-byte UTF8 characters, we should actually be using String.utf8.count.

      Related reading:
      https://developer.apple.com/documentation/swift/string
      https://developer.apple.com/documentation/swift/string/utf8view

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: