encoding Module

Note:

The encoding module cannot be imported through import encoding. Otherwise, the error message "error: can not find package'encoding'" is displayed during compilation. You are advised to import the encoding subpackage to use the encoding module.

encoding Function Description

The encoding module provides character encoding and decoding capabilities.

It can encode and decode data in Base64, Hex, JSON, and URL formats.

Package List of the encoding Module

The encoding module provides the following packages:

NameDescription
base64The base package provides Base64 encoding and decoding for strings.
hexThe hex package provides Hex encoding and decoding for strings.
jsonThe json package is used to process json data and implement conversion among String, JsonValue, and DataModel.
json.streamThe json.stream package is used for conversion between Cangjie objects and JSON data streams.
urlThe url package provides URL-related capabilities, including parsing URL components, encoding and decoding URLs, and combining URLs or paths.