Skip to content
This repository has been archived by the owner on Jun 30, 2022. It is now read-only.

Commit

Permalink
Update Encoding to UTF8 (#2289)
Browse files Browse the repository at this point in the history
  • Loading branch information
Batta32 authored and darrenj committed Sep 9, 2019
1 parent 40e163e commit d3e16e3
Show file tree
Hide file tree
Showing 12 changed files with 16 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ if ($outputs)
# Update appsettings.json
Write-Host "> Updating appsettings.json ..."
if (Test-Path $(Join-Path $projDir appsettings.json)) {
$settings = Get-Content $(Join-Path $projDir appsettings.json) | ConvertFrom-Json
$settings = Get-Content -Encoding utf8 $(Join-Path $projDir appsettings.json) | ConvertFrom-Json
}
else {
$settings = New-Object PSObject
Expand All @@ -196,7 +196,7 @@ if ($outputs)
$settings | Add-Member -Type NoteProperty -Force -Name 'microsoftAppId' -Value $appId
$settings | Add-Member -Type NoteProperty -Force -Name 'microsoftAppPassword' -Value $appPassword
foreach ($key in $outputMap.Keys) { $settings | Add-Member -Type NoteProperty -Force -Name $key -Value $outputMap[$key].value }
$settings | ConvertTo-Json -depth 100 | Out-File $(Join-Path $projDir appsettings.json)
$settings | ConvertTo-Json -depth 100 | Out-File -Encoding utf8 $(Join-Path $projDir appsettings.json)

if ($outputs.qnaMaker.value.key) { $qnaSubscriptionKey = $outputs.qnaMaker.value.key }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -297,4 +297,4 @@ foreach ($language in $languageArr)
}

# Write out config to file
$settings | ConvertTo-Json -depth 100 | Out-File $(Join-Path $outFolder "cognitivemodels.json" )
$settings | ConvertTo-Json -depth 100 | Out-File -Encoding utf8 $(Join-Path $outFolder "cognitivemodels.json" )
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ else {

Write-Host "> Getting config file ..."
$languageMap = @{ }
$config = Get-Content -Raw -Path $configFile | ConvertFrom-Json
$config = Get-Content -Encoding utf8 -Raw -Path $configFile | ConvertFrom-Json
$config.cognitiveModels.PSObject.Properties | Foreach-Object { $languageMap[$_.Name] = $_.Value }

foreach ($langCode in $languageMap.Keys) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ if ($outputs)
# Update appsettings.json
Write-Host "> Updating appsettings.json ..."
if (Test-Path $(Join-Path $projDir appsettings.json)) {
$settings = Get-Content $(Join-Path $projDir appsettings.json) | ConvertFrom-Json
$settings = Get-Content -Encoding utf8 $(Join-Path $projDir appsettings.json) | ConvertFrom-Json
}
else {
$settings = New-Object PSObject
Expand All @@ -196,7 +196,7 @@ if ($outputs)
$settings | Add-Member -Type NoteProperty -Force -Name 'microsoftAppId' -Value $appId
$settings | Add-Member -Type NoteProperty -Force -Name 'microsoftAppPassword' -Value $appPassword
foreach ($key in $outputMap.Keys) { $settings | Add-Member -Type NoteProperty -Force -Name $key -Value $outputMap[$key].value }
$settings | ConvertTo-Json -depth 100 | Out-File $(Join-Path $projDir appsettings.json)
$settings | ConvertTo-Json -depth 100 | Out-File -Encoding utf8 $(Join-Path $projDir appsettings.json)

if ($outputs.qnaMaker.value.key) { $qnaSubscriptionKey = $outputs.qnaMaker.value.key }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -297,4 +297,4 @@ foreach ($language in $languageArr)
}

# Write out config to file
$settings | ConvertTo-Json -depth 100 | Out-File $(Join-Path $outFolder "cognitivemodels.json" )
$settings | ConvertTo-Json -depth 100 | Out-File -Encoding utf8 $(Join-Path $outFolder "cognitivemodels.json" )
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ else {

Write-Host "> Getting config file ..."
$languageMap = @{ }
$config = Get-Content -Raw -Path $configFile | ConvertFrom-Json
$config = Get-Content -Encoding utf8 -Raw -Path $configFile | ConvertFrom-Json
$config.cognitiveModels.PSObject.Properties | Foreach-Object { $languageMap[$_.Name] = $_.Value }

foreach ($langCode in $languageMap.Keys) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ if ($outputs)
# Update appsettings.json
Write-Host "> Updating appsettings.json ..."
if (Test-Path $(Join-Path $projDir appsettings.json)) {
$settings = Get-Content $(Join-Path $projDir appsettings.json) | ConvertFrom-Json
$settings = Get-Content -Encoding utf8 $(Join-Path $projDir appsettings.json) | ConvertFrom-Json
}
else {
$settings = New-Object PSObject
Expand All @@ -196,7 +196,7 @@ if ($outputs)
$settings | Add-Member -Type NoteProperty -Force -Name 'microsoftAppId' -Value $appId
$settings | Add-Member -Type NoteProperty -Force -Name 'microsoftAppPassword' -Value $appPassword
foreach ($key in $outputMap.Keys) { $settings | Add-Member -Type NoteProperty -Force -Name $key -Value $outputMap[$key].value }
$settings | ConvertTo-Json -depth 100 | Out-File $(Join-Path $projDir appsettings.json)
$settings | ConvertTo-Json -depth 100 | Out-File -Encoding utf8 $(Join-Path $projDir appsettings.json)

if ($outputs.qnaMaker.value.key) { $qnaSubscriptionKey = $outputs.qnaMaker.value.key }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -297,4 +297,4 @@ foreach ($language in $languageArr)
}

# Write out config to file
$settings | ConvertTo-Json -depth 100 | Out-File $(Join-Path $outFolder "cognitivemodels.json" )
$settings | ConvertTo-Json -depth 100 | Out-File -Encoding utf8 $(Join-Path $outFolder "cognitivemodels.json" )
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ else {

Write-Host "> Getting config file ..."
$languageMap = @{ }
$config = Get-Content -Raw -Path $configFile | ConvertFrom-Json
$config = Get-Content -Encoding utf8 -Raw -Path $configFile | ConvertFrom-Json
$config.cognitiveModels.PSObject.Properties | Foreach-Object { $languageMap[$_.Name] = $_.Value }

foreach ($langCode in $languageMap.Keys) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ if ($outputs)
# Update appsettings.json
Write-Host "> Updating appsettings.json ..."
if (Test-Path $(Join-Path $projDir appsettings.json)) {
$settings = Get-Content $(Join-Path $projDir appsettings.json) | ConvertFrom-Json
$settings = Get-Content -Encoding utf8 $(Join-Path $projDir appsettings.json) | ConvertFrom-Json
}
else {
$settings = New-Object PSObject
Expand All @@ -196,7 +196,7 @@ if ($outputs)
$settings | Add-Member -Type NoteProperty -Force -Name 'microsoftAppId' -Value $appId
$settings | Add-Member -Type NoteProperty -Force -Name 'microsoftAppPassword' -Value $appPassword
foreach ($key in $outputMap.Keys) { $settings | Add-Member -Type NoteProperty -Force -Name $key -Value $outputMap[$key].value }
$settings | ConvertTo-Json -depth 100 | Out-File $(Join-Path $projDir appsettings.json)
$settings | ConvertTo-Json -depth 100 | Out-File -Encoding utf8 $(Join-Path $projDir appsettings.json)

if ($outputs.qnaMaker.value.key) { $qnaSubscriptionKey = $outputs.qnaMaker.value.key }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -297,4 +297,4 @@ foreach ($language in $languageArr)
}

# Write out config to file
$settings | ConvertTo-Json -depth 100 | Out-File $(Join-Path $outFolder "cognitivemodels.json" )
$settings | ConvertTo-Json -depth 100 | Out-File -Encoding utf8 $(Join-Path $outFolder "cognitivemodels.json" )
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ else {

Write-Host "> Getting config file ..."
$languageMap = @{ }
$config = Get-Content -Raw -Path $configFile | ConvertFrom-Json
$config = Get-Content -Encoding utf8 -Raw -Path $configFile | ConvertFrom-Json
$config.cognitiveModels.PSObject.Properties | Foreach-Object { $languageMap[$_.Name] = $_.Value }

foreach ($langCode in $languageMap.Keys) {
Expand Down

0 comments on commit d3e16e3

Please sign in to comment.