Skip to content

Incorrect encoding for strings with leading or trailing whitespace #2

@gustasthegreat

Description

@gustasthegreat

Strings with leading or trailing whitespace should be enclosed in quotes or graves to ensure correct representation.

Example Code:

test_obj = Hash.new
test_obj["key"] = "  value  "
puts CompactData.generate(test_obj)

Current Output:

The code above prints key= value . Decoding this string results in a different object since leading and trailing whitespace is ignored.

Expected Output:

The correct output should use quotes or graves, such as key=" value " or key=` value `

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