Skip to content

utilities.ConvertToBase64String

Overview

Convert the string passed as an argument to the "Server Script" into a Base64 format string.

Syntax

utilities.ConvertToBase64String(str, encoding)

Parameters

Parameter Type Required Overview
str string Yes String to convert
encoding string No Specify the string encoding%20(%27utf-8%27%20is%20specified%20if%20omitted) ('utf-8' is specified if omitted.)

Return Value

Base64 format text string

Usage Examples

The following example converts the string "Pleasanter" to a Base64 format string and outputs it to the log.

JavaScript
let base64 = utilities.ConvertToBase64String('Pleasanter', 'shift_jis');
context.Log(base64);

Cautions

This is a method used in "Server Script". It cannot be used in "Script".

Supported Versions

  1. Pleasanter 1.3.9.0 or later