Skip to content

Characters go missing during round trip #1

@euporos

Description

@euporos

Hi I'm making good use of the library for one of my projects – thanks for making it available. I did have to work around one problem though, as shown in the following example (RunKit)

train = "[1300 [[57 4.56 0.12 11 10260 240] [8.600000000000001 5.2 0.44 44 16447 142] [8.600000000000001 240.8 0.08 12 930] [8.600000000000001 0.16 4.63 230 1080] [8.600000000000001 482.1 2.82 490 572] [8.600000000000001 135.1 28.67 820 1185]]]"

troublesomeInput = "[1300 [[56 4.56 0.12 11 10260 240] [44 5.2 0.44 44 16447 142] [0 240.8 0.08 12 930] [0 0.16 4.63 230 1080] [0 482.1 2.82 490 572] [0 135.1 28.67 820 1185]]]"

let Encoder = huffmanUrlCompressor.createEncoder(train);

let encodedParam = huffmanUrlCompressor.encodeConfig(troublesomeInput,Encoder)

let decodParam= huffmanUrlCompressor.decodeConfig(encodedParam,Encoder)

decodParam turns out as:

[1300 [[56 4.56 0.12 11 10260 240] [44 5.2 0.44 44 16447 142] [0 240.8 0.08 12 930] [0 0.16 4.63 230 1080] [0 482.1 2.82 490 572] [0 135.1 28.67 820 1185]]

As you can see, the trailing Bracket has been lost in the process. Any idea as to what may be causing this behaviour?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions