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

Correctly encode strings with multi-byte UTF8 characters

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • None
    • 0.1.0
    • None

    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

            patrick.freed@mongodb.com Patrick Freed
            kaitlin.mahar@mongodb.com Kaitlin Mahar
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: