Browse Source

coreaudio-encoder: Use byte sequence for non-breaking spaces

Use explicit UTF-8 byte sequence for the "no-break space" character.

Prevents issues with certain editors, and fixes the following compiler
warning on Visual C++:

warning C4819: The file contains a character that cannot be represented
in the current code page (X). Save the file in Unicode format to prevent
data loss
jp9000 10 years ago
parent
commit
6ba5e31d05
1 changed files with 3 additions and 1 deletions
  1. 3 1
      plugins/coreaudio-encoder/encoder.cpp

+ 3 - 1
plugins/coreaudio-encoder/encoder.cpp

@@ -1200,6 +1200,8 @@ static void add_samplerates(obs_property_t *prop, ca_encoder *ca)
 	}
 }
 
+#define NBSP "\xC2\xA0"
+
 static vector<UInt32> get_bitrates(DStr &log, ca_encoder *ca,
 		Float64 samplerate)
 {
@@ -1233,7 +1235,7 @@ static vector<UInt32> get_bitrates(DStr &log, ca_encoder *ca,
 	};
 
 	for (UInt32 format_id : (ca ? *ca->allowed_formats : aac_formats)) {
-		log_to_dstr(log, ca, "Trying %s (0x%x) at %g hz\n",
+		log_to_dstr(log, ca, "Trying %s (0x%x) at %g" NBSP "hz\n",
 				format_id_to_str(format_id),
 				static_cast<uint32_t>(format_id),
 				samplerate);