diff --git a/salt/modules/file.py b/salt/modules/file.py
index <HASH>..<HASH> 100644
--- a/salt/modules/file.py
+++ b/salt/modules/file.py
@@ -4063,8 +4063,8 @@ def check_file_meta(
         tmp = salt.utils.mkstemp(text=True)
         if salt.utils.is_windows():
             contents = os.linesep.join(contents.splitlines())
-        with salt.utils.fopen(tmp, 'wb') as tmp_:
-            tmp_.write(salt.utils.to_bytes(str(contents)))
+        with salt.utils.fopen(tmp, 'w') as tmp_:
+            tmp_.write(str(contents))
         # Compare the static contents with the named file
         with salt.utils.fopen(tmp, 'r') as src:
             slines = src.readlines()
Change file.check_file_meta write mode to "w"

In order to be consistent with how `file.manage_file` writes a file,
we make `file.check_file_meta` also write the file as "w" instead of "wb".
This is necessary so that diff functionality correctly identifies
identical files when the source file is multi-line.