From 6b74e48bed0f65ef5212dea1694ef9823dcd5bef Mon Sep 17 00:00:00 2001
From: Xarblu <xarblu@protonmail.com>
Date: Fri, 14 Aug 2026 11:20:41 +0200
Subject: [PATCH] Don't use universal character names for control characters

When the Vala code is converted to C in the build process
the compiler (in this case clang) generates:

  error: universal character name refers to a control character

because "control characters (in ranges 0x0-0x1F and 0x7F-0x9F)
cannot be expressed in universal character names"
(see https://en.cppreference.com/c/language/escape)

This uses their hex representation instead
(split in tests/steam_test.vala to avoid the E of ELFfixture
being interpreted as part of the escape sequence)

Signed-off-by: Xarblu <xarblu@protonmail.com>
---
 src/models/steam-change-receipt.vala          | 4 ++--
 src/services/steam-configuration-service.vala | 2 +-
 src/services/steam-restart-state-store.vala   | 2 +-
 tests/steam_test.vala                         | 4 ++--
 4 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/models/steam-change-receipt.vala b/src/models/steam-change-receipt.vala
index 8e1faf4e..8f9a29a1 100644
--- a/src/models/steam-change-receipt.vala
+++ b/src/models/steam-change-receipt.vala
@@ -76,7 +76,7 @@ namespace ProtonPlus.Models {
 
         public static string fingerprint (string value, bool present) {
             var checksum = new Checksum (ChecksumType.SHA256);
-            var material = (present ? "present\u001f" : "absent\u001f") + value;
+            var material = (present ? "present\x1f" : "absent\x1f") + value;
             checksum.update (material.data, material.length);
             return checksum.get_string ();
         }
@@ -139,7 +139,7 @@ namespace ProtonPlus.Models {
                 var identity = configuration_intent != null
                     ? "configuration-intent"
                     : kind_to_identifier (kind);
-                return "%s\u001f%s\u001f%s".printf (target.id, identity, resource_key);
+                return "%s\x1f%s\x1f%s".printf (target.id, identity, resource_key);
             }
         }
 
diff --git a/src/services/steam-configuration-service.vala b/src/services/steam-configuration-service.vala
index b78b7ac3..9f2ca943 100644
--- a/src/services/steam-configuration-service.vala
+++ b/src/services/steam-configuration-service.vala
@@ -37,7 +37,7 @@ namespace ProtonPlus.Services {
     }
 
     public class SteamConfigurationService : Object, SteamConfigurationReconciler {
-        private const string ABSENT = "\u001eprotonplus-absent";
+        private const string ABSENT = "\x1eprotonplus-absent";
         private SteamSessionService sessions;
         private SteamRestartManager manager;
         private SteamShortcutMutator shortcut_mutator;
diff --git a/src/services/steam-restart-state-store.vala b/src/services/steam-restart-state-store.vala
index 82df1b39..2aa1a52b 100644
--- a/src/services/steam-restart-state-store.vala
+++ b/src/services/steam-restart-state-store.vala
@@ -233,7 +233,7 @@ namespace ProtonPlus.Services {
             if (schema_version == 1) {
                 if (!object.has_member ("baseline")) return null;
                 var baseline = object.get_string_member ("baseline");
-                const string legacy_absent = "\u001eprotonplus-absent";
+                const string legacy_absent = "\x1eprotonplus-absent";
                 var baseline_present = baseline != legacy_absent;
                 var desired_present = desired != legacy_absent;
                 return new SteamConfigurationIntent (file, operation, path, field_id,
diff --git a/tests/steam_test.vala b/tests/steam_test.vala
index 2be60379..64023df5 100644
--- a/tests/steam_test.vala
+++ b/tests/steam_test.vala
@@ -120,7 +120,7 @@ namespace AppTests.SteamTest {
         assert (ProtonPlus.Utils.Filesystem.create_directory (windows_directory));
         assert (ProtonPlus.Utils.Filesystem.create_directory (native_directory));
         create_executable_fixture (Path.build_filename (windows_directory, "game.exe"), "MZfixture");
-        create_executable_fixture (Path.build_filename (native_directory, "game"), "\u007fELFfixture");
+        create_executable_fixture (Path.build_filename (native_directory, "game"), "\x7f" + "ELFfixture");
 
         var steam = fixture_steam (root);
         steam.games = new List<Game> ();
@@ -188,7 +188,7 @@ namespace AppTests.SteamTest {
         var game_directory = Path.build_filename (root, "steamapps", "common", "NativeGame");
         assert (ProtonPlus.Utils.Filesystem.create_directory (config_directory));
         assert (ProtonPlus.Utils.Filesystem.create_directory (game_directory));
-        create_executable_fixture (Path.build_filename (game_directory, "game"), "\u007fELFfixture");
+        create_executable_fixture (Path.build_filename (game_directory, "game"), "\x7f" + "ELFfixture");
         assert (ProtonPlus.Utils.Filesystem.modify_file (
             Path.build_filename (config_directory, "config.vdf"),
             "\"InstallConfigStore\"\n{\n\t\"Software\"\n\t{\n\t\t\"Valve\"\n\t\t{\n\t\t\t\"Steam\"\n\t\t\t{\n\t\t\t}\n\t\t}\n\t}\n}\n"
-- 
2.55.0

