Skip to content

String encoding not working #139

@dinhero21

Description

@dinhero21

I am trying to encode a utf16 string in protodef but when I do

"string": [
  "pstring", {
    "countType": "u16"
  }
]

it will encode a utf8 string and when I add

"string": [
  "pstring", {
    "countType": "u16",
    "encoding": "utf16"
  }
]

it will just give a validation error

Here is the validation error in case you need it:

{
  "keyword": "enum",
  "dataPath": "",
  "schemaPath": "#/oneOf/0/enum",
  "params": {
    "allowedValues": [
      "native"
    ]
  },
  "message": "should be equal to one of the allowed values",
  "schema": [
    "native"
  ],
  "parentSchema": {
    "enum": [
      "native"
    ]
  },
  "data": [
    "pstring",
    {
      "countType": "u16",
      "encoding": "utf16"
    }
  ]
}

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