helm-schema-gen icon indicating copy to clipboard operation
helm-schema-gen copied to clipboard

invalid character 'ÿ' looking for beginning of value

Open sfxworks opened this issue 4 years ago • 5 comments

The default encoding is UTF-16 which yeilds invalid character 'ÿ' looking for beginning of value until converted into utf-8.

sfxworks avatar Mar 16 '21 14:03 sfxworks

@sfxworks I didn't get the issue. Do you mean that when the values.yaml contains the character ÿ in the value part (in the start or anywhere) then there's some issue? I just tried the below in the values.yaml

randomValue: happÿ

anotherRandomValue: ÿay

And it worked

...
        "anotherRandomValue": {
            "type": "string"
        },
...
       "randomValue": {
            "type": "string"
        },
...

Could you explain some more details about what's the issue you are facing and how to reproduce it?

karuppiah7890 avatar Mar 17 '21 16:03 karuppiah7890

Sorry, I am trying to say that when I run helm-schema-gen, the values.yaml.json is rendered and formatted in UTF-16, leading to helm to wonder what encoding the schema is in and failing to parse it. Can it default to UTF-8 or be set to the format the values file is in?

sfxworks avatar Mar 17 '21 17:03 sfxworks

Ah! Didn't know about this. I'll check it out @sfxworks ! Thanks for bringing this up

karuppiah7890 avatar Mar 17 '21 17:03 karuppiah7890

@sfxworks Could you help me in reproducing the issue? I'm not able to reproduce it. Whenever I create the values.schema.json, it gets created in ASCII format somehow

karuppiah7890 avatar Mar 22 '21 17:03 karuppiah7890

$ file -I values.yaml 
values.yaml: text/plain; charset=utf-8

$ file -I values.schema.json 
values.schema.json: text/plain; charset=us-ascii

karuppiah7890 avatar Mar 22 '21 17:03 karuppiah7890