<!--
{
  "availability" : [
    "iOS: 16.0.0 -",
    "iPadOS: 16.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.5.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "JavaScriptCore",
  "identifier" : "/documentation/JavaScriptCore/JSStringIsEqualToUTF8CString(_:_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "JavaScriptCore"
    ],
    "preciseIdentifier" : "c:@F@JSStringIsEqualToUTF8CString"
  },
  "title" : "JSStringIsEqualToUTF8CString(_:_:)"
}
-->

# JSStringIsEqualToUTF8CString(_:_:)

Tests whether a JavaScript string matches a null-terminated UTF-8 string.

```
func JSStringIsEqualToUTF8CString(_ a: JSStringRef!, _ b: UnsafePointer<CChar>!) -> Bool
```

## Parameters

`a`

The [`JSStringRef`](/documentation/JavaScriptCore/JSStringRef) to test.

`b`

The null-terminated UTF-8 string to test.

## Return Value

<doc://com.apple.documentation/documentation/Swift/true> if the two strings match; otherwise, <doc://com.apple.documentation/documentation/Swift/false>.

## Discussion

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)