layout: post
title: PyInstaller set encoding via LSEnvironment
date: 2021-04-02 23:10:00 +0000
author: sjie
category: python,pyinstaller
tags: python,pyinstaller,LSEnvironment,encoding

set the LANG and default character encoding via the [LSEnvironment] property

app = BUNDLE(exe,
             name='You.app',
             icon='logo.png',
             bundle_identifier=None,
             info_plist={
                 'LSEnvironment': {
                     'LANG': 'zh_CN.UTF-8',
                     'LC_CTYPE': 'zh_CN.UTF-8'
                 }
               })