All Products
Search
Document Center

Function Compute:What do I do if a code package contains garbled characters after it is uploaded to Function Compute?

Last Updated:Aug 20, 2025

This topic provides possible causes for garbled characters in the name and content of a code package after the code package is uploaded to Function Compute. You can troubleshoot the issue of garbled characters by referring to this topic.

Garbled characters in a file name

The following items list the possible causes of garbled characters in the file name of a code package after the code package is uploaded to Function Compute:

  • Inconsistent file name encoding

    In Function Compute, UTF-8 encoding is used by default to process file names. If the original file name uses a non-UTF-8 encoding method, garbled characters are generated. Make sure that the name of the uploaded code file is UTF-8 encoded.

  • Inconsistent compression encodings

    If the code is uploaded as a ZIP file, an encoding issue may arise during the compression process. For example, the default encoding of your operating system is inconsistent with the file name encoding in the ZIP file, or the encoding settings of the compression tool you use are incorrect. If encoding is not correctly set when you use a compression tool during the compression process, the file name encoding cannot be correctly identified during the decompression. As a result, garbled characters are generated.

    To resolve this issue, you must set the default encoding of your operating system according to the file name encoding in the ZIP file, and use a compression tool that supports multiple encoding methods to ensure that the file name can be correctly recognized and displayed.

Garbled characters in file content

The following items list the possible causes for garbled characters in file content after code is uploaded to Function Compute:

  • Inconsistent file encoding

    By default, UTF-8 encoding is used in Function Compute. If source code files, such as Python scripts, use a non-UTF-8 encoding method, the file content cannot be decoded and garbled characters are generated. We recommend that you use UTF-8 encoding. You can use a text editor to view and set the encoding of the file.

  • Corrupted file or incorrect format

    If the file itself is corrupted or malformed, the content of the file may fail to be decoded, which leads to garbled characters. In this case, check the integrity of the file, make sure the file is not corrupted, and try to re-download the file or get a correct file from another reliable source.

  • Special characters or non-printable characters contained in the file

    If the file contains special characters or non-printable characters and is not properly handled, garbled characters may be displayed when it is opened. We recommend you use a text editor that can recognize different encodings and convert characters.