Skip to content

Specify UTF-8 encoding for translation file opening #172

@aaltat

Description

@aaltat

Problem

I found this issue when trying to run the unit tests for seleniumlibrary on my Windows machine.

Translation files containing non-ASCII characters (e.g. Finnish ä, ö) are read incorrectly on Windows. The _translation() function in utils/translations.py opens the file without specifying an encoding, so Python falls back to the system locale encoding (cp1252 on Windows). This silently corrupts keyword names and documentation containing multi-byte UTF-8 characters.

For example, a translated keyword name hallinnoi_hälytys is stored as hallinnoi_hälytys in keywords_spec, making it impossible to look up by its correct name.

This does not affect CI pipelines running on Linux, where the default encoding is already UTF-8, which explains why the bug only reproduces locally on Windows.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions