Skip to content

UTF-8 Encoding Error #167

@FetFlex

Description

@FetFlex

Steps to reproduce

If i want to update a Flexible asset where one of the traits include a Danish character (ÆØÅ). I just get "400 Bad Request" from the API.
Set-ITGlueFlexibleAssets -data $body -id 7651225445526866

I am not that expirenced with GitHub :)

But in my local copy of the module i added a small change to the "APICalls.ps1" file so it converts the body to bytes before transmission:
$body = [System.Text.Encoding]::UTF8.GetBytes((@{'data'=$Data} | ConvertTo-Json -Depth $ITGlue_JSON_Conversion_Depth))

Expected behavior

It should return the updated object.

Actual behavior

When i update an item that has a Danish character in one of the traits i get an error back from the API:
Set-ITGlueFlexibleAssets: Response status code does not indicate success: 400 (Bad Request).

Screenshots

If applicable, please add screenshots to help describe the issue.

Environment

Please share additional details about your environment. Version information for:

OsName               : Microsoft Windows Server 2022 Standard
OsOperatingSystemSKU : StandardServerEdition
OsArchitecture       : 64-bit
WindowsVersion       : 2009
WindowsBuildLabEx    : 20348.1.amd64fre.fe_release.210507-1500
OsLanguage           : en-US
OsMuiLanguages       : {en-US}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions