Skip to content

Extraction fails for GBK-encoded ZIP archives: "pq: invalid byte sequence for encoding UTF8" #3225

@sd1114820

Description

@sd1114820

Describe the bug Cloudreve fails to extract ZIP archives containing files with non-UTF-8 encodings (e.g., GBK/GB18030). The process terminates with a database error: .pq: invalid byte sequence for encoding "UTF8"

To Reproduce Steps to reproduce the behavior:

Upload a ZIP file containing files named in Chinese (GBK encoding).

Click on the file and select "Extract".

The task fails immediately.

See error in logs.pq: invalid byte sequence for encoding "UTF8"

Expected behavior The system should automatically detect the encoding or convert filenames to UTF-8 to prevent database errors. Alternatively, it should skip the problematic files instead of crashing the entire extraction task.

Screenshots (Paste your error screenshot here)

Desktop (please complete the following information):

OS: WIN11

Browser: EDGE

Version: 144.0.3719.82

Smartphone (please complete the following information):

Device:

OS:

Browser:

Version:

Additional context The error code indicates a GBK character. The PostgreSQL database requires strict UTF-8 input, causing the insertion to fail.0xd3 0xef

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions