Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Escape non-ASCII characters in properties files #53

Open
olim7t opened this issue Mar 26, 2024 · 0 comments
Open

Escape non-ASCII characters in properties files #53

olim7t opened this issue Mar 26, 2024 · 0 comments

Comments

@olim7t
Copy link

olim7t commented Mar 26, 2024

Cassandra allows non-ASCII characters in datacenter names, for example DåtåCenter1.

However, the cassandra-rackdc.properties file is decoded using ISO-8859-1, so it needs to use Unicode escapes:

dc=D\u00e5t\u00e5Center1

Currently this is not the case, cass-config-builder writes the unescaped Unicode string:

# Wrong, Cassandra won't decode this properly
dc=DåtåCenter1

Minimal test to reproduce this in build_config_test.clj:

(deftest test-non-ascii-dc
  (let [datacenter-info {:name "DåtåCenter1"}
        definitions-data (test-data/get-definitions-data "cassandra" helper/default-cassandra-version)
        built-configs (bc/build-configs definitions-data {:datacenter-info datacenter-info})]
    (is (= "D\\u00e5t\\u00e5Center1" (get-in built-configs [:cassandra-rackdc-properties :dc])))
  )
)

(This potentially extends to other properties files, I haven't compiled an extensive list.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant