Skip to content
This repository has been archived by the owner on May 19, 2021. It is now read-only.

Commit

Permalink
fix utf8 project path parsing fixes #72
Browse files Browse the repository at this point in the history
  • Loading branch information
unitycoder committed Dec 5, 2018
1 parent bcefe97 commit 48c3075
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions UnityLauncher/Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,14 @@ void UpdateRecentProjectsList()
{
RegistryKey key = hklm.OpenSubKey(registryPathsToCheck[i]);

if (key == null) continue;
if (key == null)
{
continue;
}
else
{
Console.WriteLine("Null registry key at "+ registryPathsToCheck[i]);
}

// parse recent project path
foreach (var valueName in key.GetValueNames())
Expand All @@ -320,7 +327,7 @@ void UpdateRecentProjectsList()
if (valueKind == RegistryValueKind.Binary)
{
byte[] projectPathBytes = (byte[])key.GetValue(valueName);
projectPath = Encoding.Default.GetString(projectPathBytes, 0, projectPathBytes.Length - 1);
projectPath = Encoding.UTF8.GetString(projectPathBytes, 0, projectPathBytes.Length - 1);
}
else // should be string then
{
Expand All @@ -330,6 +337,7 @@ void UpdateRecentProjectsList()
// first check if whole folder exists, if not, skip
if (Directory.Exists(projectPath) == false)
{
Console.WriteLine("Recent project directory not found, skipping: "+ projectPath);
continue;
}

Expand Down

0 comments on commit 48c3075

Please sign in to comment.