Encoding UTF16 JSONs as UTF8

I have a Jason I am getting with http.get. However, the Jason is encoded in UTF16 and I believe this is preventing it from being parsed correctly. what is the fasI am wondering what the best way to get, encode from UTF16 to UTF8, and finally parse it?

Have you seen the transcode function?

help?> transcode
search: transcode

  transcode(T, src)

  Convert string data between Unicode encodings. src is either a String or a
  Vector{UIntXX} of UTF-XX code units, where XX is 8, 16, or 32. T indicates the
  encoding of the return value: String to return a (UTF-8 encoded) String or UIntXX to
  return a Vector{UIntXX} of UTF-XX data. (The alias Cwchar_t can also be used as the
  integer type, for converting wchar_t* strings used by external C libraries.)

  The transcode function succeeds as long as the input data can be reasonably
  represented in the target encoding; it always succeeds for conversions between UTF-XX
  encodings, even for invalid Unicode data.

  Only conversion to/from UTF-8 is currently supported.
3 Likes

Thank you