Skip to content

Locale-sensitive toLowerCase() / toUpperCase() across the function library #4393

Description

@ruispereira

Affected version: 26.4.2 (confirmed still present in 26.5.1)
Component: com.arcadedb.function (multiple)

Summary

At least 10 call sites use the JVM default locale for case conversion of
keywords / config names: text/ToLowerFunction.java:48,
text/ToUpperFunction.java:48, text/ToBooleanFunction.java:48,
convert/ConvertToBoolean.java:55, util/UtilCompress.java:60,
math/RoundFunction.java:71, date/AbstractDateFunction.java (unitToMillis),
date/DateField.java:60, normalize/NormalizeFunction.java:43,
vector/VectorDistanceFunction.java.

Impact

On tr_TR, "INFO".toLowerCase()"ınfo"; toBoolean("TRUE") returns
null; util.compress(x, "GZIP") throws "Unsupported compression algorithm:
gzıp". Non-deterministic results across deployments.

Suggested fix

Use toLowerCase(Locale.ROOT) / toUpperCase(Locale.ROOT) for parsing /
keyword comparison. For user-facing string transforms, accept an explicit
locale parameter.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions