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

[Bug]: HAB_FREEZE doesn't support unicode characters #25

Open
MHendricks opened this issue Jan 24, 2023 · 1 comment
Open

[Bug]: HAB_FREEZE doesn't support unicode characters #25

MHendricks opened this issue Jan 24, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@MHendricks
Copy link
Member

Summary

Ensure we can encode/decode unicode characters in HAB_FREEZE.

Expected Behavior

You should be able to store unicode values in hab json files.

Steps to Reproduce Behavior

This code seems like it shows how encode_freeze and decode_freeze should be modified.

import base64
import json
in_dict = ["\U0001F389"]
data = json.dumps(in_dict)

# Encoding
data = data.encode('utf-8')
data = base64.b64encode(data)
data = data.decode("utf-8")

# Decoding
data = data.encode('ascii')
data = base64.b64decode(data)
data = data.decode('utf-8')
data = json.loads(data)

Solution

No response

Environment

All os's

Additional Context

@MHendricks MHendricks added the bug Something isn't working label Jan 24, 2023
@MHendricks
Copy link
Member Author

Also ensure that unicode is supported by all of HAB. Here is a test configuration.

{
    "name": "utf8",
    "inherits": false,
    "distros": [],
    "environment": {
        "set": {
            "UTF_VALUE": "[\ud83c\udf89]",
            "ASCII_VALUE": "[ascii]"
        }
    }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant