Skip to content

Instantly share code, notes, and snippets.

@tcztzy
Last active February 21, 2022 03:41
Show Gist options
  • Save tcztzy/aff7c8ba21364181638d172844ab373d to your computer and use it in GitHub Desktop.
Save tcztzy/aff7c8ba21364181638d172844ab373d to your computer and use it in GitHub Desktop.
Meson build convert source code file encoding (Meson 转换源码编码 gb2312/gbk/cp1252/etc. to utf-8)
fs = import('fs')
executable('some_exe',
configure_file(
input: 'template.file', # file name should match
output: 'output.file', # whatever you want
configuration: {
'content': fs.read('input.file', encoding: 'cp1252'), # change the encoding you want, key `content` should match the template
}
),
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment