String Encoding and Decoding
Introduction
This sample shows how to output strings in a specified format and obtain error messages corresponding to error codes. It also demonstrates string encoding and decoding. The sample app is as follows.

Functions
-
Output in a specified format: You can use the app to output a string in different formats.
-
Error code parsing: You can input an error code in the app to obtain the corresponding error message.
-
Text encoding and decoding: You can use the app to encode and decode strings.
Required Permissions
N/A
Usage
-
Touch Output in specified format. Your input is then displayed in different formats, such as integer, floating point number, and string.
-
Touch Obtain error details. The error message corresponding to the error code is displayed in the text box on each line.
-
Touch Text encoder. Your input is then encoded and displayed, together with the information about data reading and writing.
-
Touch Text decoder. The encoded text content is decoded, and the output displayed is the same as what you input.
Constraints
-
This sample can only be run on standard-system devices.
-
DevEco Studio 3.0 Beta3 (Build Version: 3.0.0.901, built on May 30, 2022) must be used.