Title: Loading modules.json with the wrong encoding · Issue #218 · microsoft/unitysetup.powershell · GitHub
Open Graph Title: Loading modules.json with the wrong encoding · Issue #218 · microsoft/unitysetup.powershell
X Title: Loading modules.json with the wrong encoding · Issue #218 · microsoft/unitysetup.powershell
Description: After installing Unity Editor 2019.4.15f1 with Unity Hub 2.4.2 on Japanese Windows 10 Pro 2004, Get-UnitySetupInstance complains with the following error: PS C:\Program Files\Unity\Hub\Editor\2019.4.15f1> Get-UnitySetupInstance 警告: ':' ま...
Open Graph Description: After installing Unity Editor 2019.4.15f1 with Unity Hub 2.4.2 on Japanese Windows 10 Pro 2004, Get-UnitySetupInstance complains with the following error: PS C:\Program Files\Unity\Hub\Editor\2019....
X Description: After installing Unity Editor 2019.4.15f1 with Unity Hub 2.4.2 on Japanese Windows 10 Pro 2004, Get-UnitySetupInstance complains with the following error: PS C:\Program Files\Unity\Hub\Editor\2019....
Opengraph URL: https://github.com/microsoft/unitysetup.powershell/issues/218
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Loading modules.json with the wrong encoding","articleBody":"After installing Unity Editor 2019.4.15f1 with Unity Hub 2.4.2 on Japanese Windows 10 Pro 2004, `Get-UnitySetupInstance` complains with the following error:\r\n\r\n```console\r\nPS C:\\Program Files\\Unity\\Hub\\Editor\\2019.4.15f1\u003e Get-UnitySetupInstance\r\n警告: ':' または '}' ではなく無効なオブジェクトが渡されました。 (7767): [{\"id\":\"visualstudio\",\"name\":\"Microsoft Visual Studio Community 2019\",\"description\":\"Downloads and installs.... (snipped)\r\n```\r\n\r\nIt orignates from this line:\r\n\r\nhttps://github.com/microsoft/unitysetup.powershell/blob/602fb720ea42220dae7a85b5b63cbc5538ff06a4/UnitySetup/UnitySetup.psm1#L1236\r\n\r\n`Get-Content -Raw` loads `modules.json` with the wrong encoding which causes subsequent `ConvertFrom-Json` to fail:\r\n\r\n```console\r\nPS C:\\Program Files\\Unity\\Hub\\Editor\\2019.4.15f1\u003e Get-Content .\\modules.json -Raw | ConvertFrom-Json\r\nConvertFrom-Json : ':' または '}' ではなく無効なオブジェクトが渡されました。 (7767): [{\"id\":\"visualstudio\",\"name\":\"Microsoft Visual Studio Community 2019\",\"description\":\"Downloads and installs.... (snipped)\r\n```\r\n\r\n`modules.json` is actually in UTF-8 without BOM. `Get-Content -Encoding UTF8` would workaround this case, but I'm not confident whether it's a correct fix:\r\n\r\n```console\r\nPS C:\\Program Files\\Unity\\Hub\\Editor\\2019.4.15f1\u003e Get-Content .\\modules.json -Encoding UTF8 | ConvertFrom-Json\r\n\r\n\r\nid : visualstudio\r\nname : Microsoft Visual Studio Community 2019\r\ndescription : Downloads and installs Microsoft Visual Studio Community 2019. By installing this you accept the license terms for Visual Studio.\r\ndownloadUrl : https://go.microsoft.com/fwlink/?linkid=2086755\r\ncategory : Dev tools\r\ninstalledSize : 1331200000\r\ndownloadSize : 1363148800\r\nvisible : True\r\nselected : False\r\ncmd : --productId \"Microsoft.VisualStudio.Product.Community\" --add \"Microsoft.VisualStudio.Workload.ManagedGame\" --add \"Microsoft.VisualStudio.Workload.NativeDesktop\" --add \"Microsoft.VisualStudio.Component.VC.Tools.x86.x64\" --add \"Microsoft.VisualStudio.Comp\r\n onent.Windows10SDK.16299.Desktop\" --campaign \"Unity3d_Unity\" --passive --norestart --wait\r\neulaUrl1 : https://go.microsoft.com/fwlink/?linkid=2092534\r\neulaLabel1 : Visual Studio 2019 Community License Terms\r\neulaMessage : Please review and accept the license terms before downloading and installing Microsoft Visual Studio.\r\n\r\n...(snipped)...\r\n\r\nid : language-ja\r\nname : 日本語\r\ndescription : 日本語\r\ndownloadUrl : https://new-translate.unity3d.jp/v1/live/54/2019.4/ja\r\ncategory : Language packs (Preview)\r\nvisible : True\r\nselected : False\r\ndestination : {UNITY_PATH}/Editor/Data/Localization\r\ninstalledSize : 1739231\r\ndownloadSize : 1739231\r\n\r\n...(snipped)\r\n```\r\n\r\nIt would be better to have a fall back path on modules.json parsing failures by adding a try-catch block.","author":{"url":"https://github.com/yaegashi","@type":"Person","name":"yaegashi"},"datePublished":"2020-11-29T05:20:23.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/218/unitysetup.powershell/issues/218"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:977cf5ab-7a80-77a4-6ba9-e2b7c377c1a8 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | ABB4:1C3EE2:395342E:4AA13A2:697D8CDC |
| html-safe-nonce | 8cd6d64800e26c5ee1fd7b882a1a75ac617a191e9532160dea8f703d5bd08fcb |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBQkI0OjFDM0VFMjozOTUzNDJFOjRBQTEzQTI6Njk3RDhDREMiLCJ2aXNpdG9yX2lkIjoiNDY0OTIzNTk3MDA3ODM3OTIyOCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 4956e54f7e8b9e72f12d6e1df3aea64ea2b262654e15491ef25da4374bf1bf6f |
| hovercard-subject-tag | issue:752842027 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/microsoft/unitysetup.powershell/218/issue_layout |
| twitter:image | https://opengraph.githubassets.com/7180bd9ac31098f1544a87e52034a9066f8d41a8ea3a31c82c7096693147bba7/microsoft/unitysetup.powershell/issues/218 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/7180bd9ac31098f1544a87e52034a9066f8d41a8ea3a31c82c7096693147bba7/microsoft/unitysetup.powershell/issues/218 |
| og:image:alt | After installing Unity Editor 2019.4.15f1 with Unity Hub 2.4.2 on Japanese Windows 10 Pro 2004, Get-UnitySetupInstance complains with the following error: PS C:\Program Files\Unity\Hub\Editor\2019.... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | yaegashi |
| hostname | github.com |
| expected-hostname | github.com |
| None | 60279d4097367e16897439d16d6bbe4180663db828c666eeed2656988ffe59f6 |
| turbo-cache-control | no-preview |
| go-import | github.com/microsoft/unitysetup.powershell git https://github.com/microsoft/unitysetup.powershell.git |
| octolytics-dimension-user_id | 6154722 |
| octolytics-dimension-user_login | microsoft |
| octolytics-dimension-repository_id | 112545453 |
| octolytics-dimension-repository_nwo | microsoft/unitysetup.powershell |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 112545453 |
| octolytics-dimension-repository_network_root_nwo | microsoft/unitysetup.powershell |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 7c85641c598ad130c74f7bcc27f58575cac69551 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width