> For the complete documentation index, see [llms.txt](https://osl.mistium.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://osl.mistium.com/legacy-osl-originos/prototype-helpers/.encodeutf16.md).

# string.encodeUTF16

## Description

encodeUTF16 converts a string to its UTF-16 encoded representation.

## Parameters

encodeUTF16 takes no parameters.

## Usage On Strings

```javascript
str = "Hello"
log str.encodeUTF16()
// Returns UTF-16 encoded string

str = "🌟"
log str.encodeUTF16()
// Unicode characters are properly encoded

// Can be decoded back with decodeUTF16
encoded = "Hello".encodeUTF16()
decoded = encoded.decodeUTF16()
log decoded
// "Hello"
```
