<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Special Characters utf8-bom with the API in Network Platform API</title>
    <link>https://community.cisco.com/t5/network-platform-api/special-characters-utf8-bom-with-the-api/m-p/5415458#M2772</link>
    <description>&lt;P&gt;Hmm okay. Try changing this:&lt;/P&gt;&lt;PRE&gt;"Content-Type" = 'application/json'&lt;/PRE&gt;&lt;P&gt;To this:&lt;/P&gt;&lt;PRE&gt;"Content-Type" = 'application/json ; charset=utf-8'&lt;/PRE&gt;</description>
    <pubDate>Fri, 01 Feb 2019 08:31:11 GMT</pubDate>
    <dc:creator>BrechtSchamp</dc:creator>
    <dc:date>2019-02-01T08:31:11Z</dc:date>
    <item>
      <title>Special Characters utf8-bom with the API</title>
      <link>https://community.cisco.com/t5/network-platform-api/special-characters-utf8-bom-with-the-api/m-p/5415455#M2769</link>
      <description>&lt;P&gt;after updating all the organization name with PowerShell and the API I noticed a formatting error.&lt;BR /&gt;Special Characters like øæå are replaced with squares.&lt;/P&gt;&lt;P&gt;Does anyone know what kind of little parameter i need to add in my code to make it support our nordic characters?&lt;/P&gt;&lt;P&gt;any help would be greatly appreciated.&lt;/P&gt;</description>
      <pubDate>Fri, 01 Feb 2019 07:12:06 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-platform-api/special-characters-utf8-bom-with-the-api/m-p/5415455#M2769</guid>
      <dc:creator>bjowol</dc:creator>
      <dc:date>2019-02-01T07:12:06Z</dc:date>
    </item>
    <item>
      <title>Re: Special Characters utf8-bom with the API</title>
      <link>https://community.cisco.com/t5/network-platform-api/special-characters-utf8-bom-with-the-api/m-p/5415456#M2770</link>
      <description>&lt;P&gt;Have you tried using URL encoding for those characters? The name parameter ends up as a param in the get URL so depending on how the script works this might be needed.&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;øæå = %C3%B8%C3%A6%C3%A5&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Online converter if needed:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;A href="https://www.w3schools.com/tags/ref_urlencode.asp" target="_blank" rel="nofollow noopener noreferrer"&gt;https://www.w3schools.com/tags/ref_urlencode.asp&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 01 Feb 2019 07:53:08 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-platform-api/special-characters-utf8-bom-with-the-api/m-p/5415456#M2770</guid>
      <dc:creator>BrechtSchamp</dc:creator>
      <dc:date>2019-02-01T07:53:08Z</dc:date>
    </item>
    <item>
      <title>Re: Special Characters utf8-bom with the API</title>
      <link>https://community.cisco.com/t5/network-platform-api/special-characters-utf8-bom-with-the-api/m-p/5415457#M2771</link>
      <description>&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;$customuri&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;$org.samlConsumerUrl.Split&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'/'&lt;/SPAN&gt;&lt;SPAN&gt;)[&lt;/SPAN&gt;&lt;SPAN&gt;2&lt;/SPAN&gt;&lt;SPAN&gt;].split(&lt;/SPAN&gt;&lt;SPAN&gt;'.'&lt;/SPAN&gt;&lt;SPAN&gt;)[&lt;/SPAN&gt;&lt;SPAN&gt;0&lt;/SPAN&gt;&lt;SPAN&gt;]&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;$updateuri&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;'https://{1}.meraki.com/api/v0/organizations/{0}'&lt;/SPAN&gt; &lt;SPAN&gt;-f&lt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;&lt;SPAN&gt;&lt;BR /&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2019-02-01 09_01_48-● Update.Meraki.Org.Name.ps1 - Untitled (Workspace) - Visual Studio Code.png" style="width: 326px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="image.png"&gt;&lt;img src="https://community.cisco.com/t5/image/serverpage/image-id/262051i1B3ADE530734B090/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2019-02-01 09_02_38-Organization settings - Meraki Dashboard.png" style="width: 217px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="image.png"&gt;&lt;img src="https://community.cisco.com/t5/image/serverpage/image-id/262054i86DEF00AC285C818/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Unfortunatly this did not work. &lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 01 Feb 2019 08:04:31 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-platform-api/special-characters-utf8-bom-with-the-api/m-p/5415457#M2771</guid>
      <dc:creator>bjowol</dc:creator>
      <dc:date>2019-02-01T08:04:31Z</dc:date>
    </item>
    <item>
      <title>Re: Special Characters utf8-bom with the API</title>
      <link>https://community.cisco.com/t5/network-platform-api/special-characters-utf8-bom-with-the-api/m-p/5415458#M2772</link>
      <description>&lt;P&gt;Hmm okay. Try changing this:&lt;/P&gt;&lt;PRE&gt;"Content-Type" = 'application/json'&lt;/PRE&gt;&lt;P&gt;To this:&lt;/P&gt;&lt;PRE&gt;"Content-Type" = 'application/json ; charset=utf-8'&lt;/PRE&gt;</description>
      <pubDate>Fri, 01 Feb 2019 08:31:11 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-platform-api/special-characters-utf8-bom-with-the-api/m-p/5415458#M2772</guid>
      <dc:creator>BrechtSchamp</dc:creator>
      <dc:date>2019-02-01T08:31:11Z</dc:date>
    </item>
    <item>
      <title>Re: Special Characters utf8-bom with the API</title>
      <link>https://community.cisco.com/t5/network-platform-api/special-characters-utf8-bom-with-the-api/m-p/5415459#M2773</link>
      <description>&lt;P&gt;thanks for your input.&lt;/P&gt;&lt;P&gt;this is my current header:&lt;/P&gt;&lt;PRE&gt;$header = @{
    'X-Cisco-Meraki-API-Key' = $apikey
    'Content-Type' = 'application/json ; charset=utf-8'
    'Accept-Language' = 'nb-NO,nb;q=0.9,no-NO;q=0.8,no;q=0.6,nn-NO;q=0.5,nn;q=0.4,en-US;q=0.3,en;q=0.1'
    
}&lt;/PRE&gt;&lt;P&gt;Ive also tried a few other charsets, like iso and sorts.&lt;/P&gt;&lt;P&gt;also tried this.&lt;/P&gt;&lt;PRE&gt;$header = @{
    'X-Cisco-Meraki-API-Key' = $apikey
    'Content-Type' = 'application/json'
    'Accept-Language' = 'nb-NO,nb;q=0.9,no-NO;q=0.8,no;q=0.6,nn-NO;q=0.5,nn;q=0.4,en-US;q=0.3,en;q=0.1'
    'Accept-Charset'=  'utf-8, iso-8859-1;q=0.5, *;q=0.1'
}&lt;/PRE&gt;</description>
      <pubDate>Fri, 01 Feb 2019 08:46:06 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-platform-api/special-characters-utf8-bom-with-the-api/m-p/5415459#M2773</guid>
      <dc:creator>bjowol</dc:creator>
      <dc:date>2019-02-01T08:46:06Z</dc:date>
    </item>
    <item>
      <title>Re: Special Characters utf8-bom with the API</title>
      <link>https://community.cisco.com/t5/network-platform-api/special-characters-utf8-bom-with-the-api/m-p/5415460#M2774</link>
      <description>&lt;P&gt;This worked for me:&lt;/P&gt;&lt;PRE&gt;[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12

$api_key = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'

$header = @{
	
	"X-Cisco-Meraki-API-Key" = $api_key
	"Content-Type" = 'application/json ; charset=utf-8'
	
}

$api = @{

	"endpoint" = 'https://xxxx.meraki.com/api/v0'

}

$api.url = '/networks/xxxmy-network-idxxxx'
$uri = $api.endpoint + $api.url

$parms = @{
	name = 'My Network øæå'
}
$json = $parms | ConvertTo-Json
$change = Invoke-RestMethod -Method Put -Uri $uri -Body $json -Headers $header
$change&lt;/PRE&gt;&lt;P&gt;I set the encoding of the file to UTF-8 from Notepad++ and then ran it from powershell.&lt;/P&gt;&lt;P&gt;Maybe what Nick did here will also help:&lt;/P&gt;&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="system_encoding.PNG" style="width: 690px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="image.png"&gt;&lt;img src="https://community.cisco.com/t5/image/serverpage/image-id/262055i30A57FB7B5B0E84D/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Source: &lt;A href="https://stackoverflow.com/questions/21598398/wrong-encoding-on-powershell-invoke-webrequest-post" target="_blank" rel="noopener nofollow noreferrer"&gt;https://stackoverflow.com/questions/21598398/wrong-encoding-on-powershell-invoke-webrequest-post&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 01 Feb 2019 08:53:23 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-platform-api/special-characters-utf8-bom-with-the-api/m-p/5415460#M2774</guid>
      <dc:creator>BrechtSchamp</dc:creator>
      <dc:date>2019-02-01T08:53:23Z</dc:date>
    </item>
    <item>
      <title>Re: Special Characters utf8-bom with the API</title>
      <link>https://community.cisco.com/t5/network-platform-api/special-characters-utf8-bom-with-the-api/m-p/5415461#M2775</link>
      <description>&lt;P&gt;i appreciate your responses. i tried them in both vscode(with all types of encoding) and in ISE.&lt;/P&gt;&lt;P&gt;i also tried this&lt;/P&gt;&lt;PRE&gt;            $change = Invoke-RestMethod -Method Put -Uri $updateuri -Body $json -Headers $header -ContentType "text/plain; charset=utf-8"
            $change&lt;/PRE&gt;&lt;P&gt;I have a support case open with meraki. ill see if they can come up with something.&lt;/P&gt;&lt;P&gt;i have not tried to do the same with a network name. cant think of any reasons why there would be a difference between network name and org name, but there might be.&lt;/P&gt;</description>
      <pubDate>Fri, 01 Feb 2019 12:22:18 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-platform-api/special-characters-utf8-bom-with-the-api/m-p/5415461#M2775</guid>
      <dc:creator>bjowol</dc:creator>
      <dc:date>2019-02-01T12:22:18Z</dc:date>
    </item>
    <item>
      <title>Re: Special Characters utf8-bom with the API</title>
      <link>https://community.cisco.com/t5/network-platform-api/special-characters-utf8-bom-with-the-api/m-p/5415462#M2776</link>
      <description>&lt;P&gt;found a solution based on your reply.&lt;/P&gt;&lt;PRE&gt;$header = @{
     "X-Cisco-Meraki-API-Key" = $apikey 
     "Content-Type" = 'application/json ; charset=utf-16' 
}

            $customuri = $org.samlConsumerUrl.Split('/')[2].split('.')[0]
            $updateuri = 'https://{1}.meraki.com/api/v0/organizations/{0}' -f $org.id,$customuri
            $parms = @{
                name = $WantedName
            }
            $json = $parms | ConvertTo-Json
            $body = [System.Text.Encoding]::UTF8.GetBytes($json)

            $change = Invoke-RestMethod -Method Put -Uri $updateuri -Body $body -Headers $header
            $change&lt;/PRE&gt;</description>
      <pubDate>Fri, 01 Feb 2019 12:48:33 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-platform-api/special-characters-utf8-bom-with-the-api/m-p/5415462#M2776</guid>
      <dc:creator>bjowol</dc:creator>
      <dc:date>2019-02-01T12:48:33Z</dc:date>
    </item>
    <item>
      <title>Re: Special Characters utf8-bom with the API</title>
      <link>https://community.cisco.com/t5/network-platform-api/special-characters-utf8-bom-with-the-api/m-p/5415463#M2777</link>
      <description>&lt;P&gt;It was this that finally did the trick I suppose, in combination with the correct charset setting?&lt;/P&gt;&lt;PRE&gt;$body = [System.Text.Encoding]::UTF8.GetBytes($json)&lt;/PRE&gt;</description>
      <pubDate>Fri, 01 Feb 2019 12:52:52 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-platform-api/special-characters-utf8-bom-with-the-api/m-p/5415463#M2777</guid>
      <dc:creator>BrechtSchamp</dc:creator>
      <dc:date>2019-02-01T12:52:52Z</dc:date>
    </item>
    <item>
      <title>Re: Special Characters utf8-bom with the API</title>
      <link>https://community.cisco.com/t5/network-platform-api/special-characters-utf8-bom-with-the-api/m-p/5415464#M2778</link>
      <description>&lt;P&gt;it was probably just that one-liner.&lt;/P&gt;&lt;P&gt;i tested with a bunch of different header parameters and running powershell in different charsets.&lt;/P&gt;&lt;P&gt;glad you pointed me to the solution though!&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I believe it converts the data to bytes, and just sends the bytes, ignoring charsets or something.&lt;/P&gt;</description>
      <pubDate>Fri, 01 Feb 2019 13:25:07 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-platform-api/special-characters-utf8-bom-with-the-api/m-p/5415464#M2778</guid>
      <dc:creator>bjowol</dc:creator>
      <dc:date>2019-02-01T13:25:07Z</dc:date>
    </item>
  </channel>
</rss>

