[glib: 1/2] msvc: set the execution and source encoding to utf-8. Fixes #1294



commit 947b585ca637409bfc5400f8307535d23b7d1f6d
Author: Christoph Reiter <reiter christoph gmail com>
Date:   Sun May 27 20:11:21 2018 +0200

    msvc: set the execution and source encoding to utf-8. Fixes #1294
    
    gcc defaults to utf-8 for both (see -fexec-charset and -finput-charset in the
    gcc man page) so we should use it with msvc as well.
    
    msvc by default uses the locale encoding unless there is a BOM, see
    https://msdn.microsoft.com/en-us/library/mt708821.aspx

 meson.build | 2 ++
 1 file changed, 2 insertions(+)
---
diff --git a/meson.build b/meson.build
index 62989bedd..d173d57bf 100644
--- a/meson.build
+++ b/meson.build
@@ -23,6 +23,8 @@ if cc.get_id() == 'msvc'
   # Disable SAFESEH with MSVC for plugins and libs that use external deps that
   # are built with MinGW
   noseh_link_args = ['/SAFESEH:NO']
+  # Set the input and exec encoding to utf-8, like is the default with GCC
+  add_project_arguments(cc.get_supported_arguments(['/utf-8']), language: 'c')
 else
   noseh_link_args = []
   # -mms-bitfields vs -fnative-struct ?


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]