ConvertEncoding

Name

ConvertEncoding

Syntax

ConvertEncoding (String str, String fromCodePage, String toCodePage)

Purpose

To return a string in the given encoding.

Description

Returns a string in the specified encoding, codepage value.

Return Type

String

Parameters

Str [System.String] – The string to convert

fromCodePage [System.String] – The code page the string is currently encoded in. Default is UTF-8

toCodePage [System.String] – The code page to convert to. Default is UTF-8

Example

In this example, we are passing the required parameters to the function transformation object using a Variables object.

Where,

str = Helloαβ

fromCodePage = 65001 (UTF-8 - Default)

toCodePage = 20127 (US - ASCII)

Right-click on the function transformation object and select Preview Output. You can see that Astera has returned a string in the Output. This means that the provided string’s encoding has been successfully converted

Last updated

© Copyright 2023, Astera Software