---
layout: doc
title: strings / string_encode
---
# string_encode

### SYNOPSIS

    buffer string_encode(string str, string encoding);

### DESCRIPTION

    Encode the given string str(in UTF-8) using given encoding, return an
    buffer of bytes.

### SEE ALSO

    string_decode, buffer_transcode
