---
title: "JSStringGetMaximumUTF8CStringSize(_:)"
framework: javascriptcore
role: symbol
role_heading: Function
path: "javascriptcore/jsstringgetmaximumutf8cstringsize(_:)"
---

# JSStringGetMaximumUTF8CStringSize(_:)

Returns the maximum number of bytes a JavaScript string uses when you convert it into a null-terminated UTF-8 string.

## Declaration

```swift
func JSStringGetMaximumUTF8CStringSize(_ string: JSStringRef!) -> Int
```

## Parameters

- `string`: The doc://com.apple.javascriptcore/documentation/JavaScriptCore/JSStringRef with the maximum converted size (in bytes) you want to know.

## Return Value

Return Value The maximum number of bytes that might be necessary to convert string into a null-terminated UTF-8 string. The number of bytes that the conversion actually ends up requiring can be less than this, but never more.

## See Also

### Accessing JavaScript String Information

- [JSStringGetLength(_:)](javascriptcore/jsstringgetlength(_:).md)
- [JSStringGetCharactersPtr(_:)](javascriptcore/jsstringgetcharactersptr(_:).md)
- [JSStringGetUTF8CString(_:_:_:)](javascriptcore/jsstringgetutf8cstring(_:_:_:).md)
