<s> """<STR_LIT>""" <EOL> import sys <EOL> from pyqode . qt import QtWidgets <EOL> from pyqode . core import dialogs <EOL> from common import setup_editor , get_file_path <EOL> app = QtWidgets . QApplication ( sys . argv ) <EOL> success = False <EOL> editor = setup_editor ( ) <EOL> pth = get_file_path ( ) <EOL> success = False <EOL> encoding = '<STR_LIT:utf-8>' <EOL> while not success : <EOL> try : <EOL> editor . file . open ( pth , encoding = encoding , use_cached_encoding = False ) <EOL> except UnicodeDecodeError : <EOL> encoding = dialogs . DlgEncodingsChoice . choose_encoding ( <EOL> editor , pth , encoding ) <EOL> else : <EOL> success = True <EOL> app . exec_ ( ) </s>
