From 2aec871c0ea0e4d567aba6c6750d87b1bca258ed Mon Sep 17 00:00:00 2001 From: Miguel Nogueira Date: Wed, 12 Jun 2019 15:39:17 +0100 Subject: [PATCH] UTF8 Encode file output --- .idea/workspace.xml | 25 +++++++++++++++---------- pyvpn | 3 +-- 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 94ccdf2..8cad95e 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -1,10 +1,7 @@ - - - - + @@ -163,7 +167,8 @@ - @@ -227,8 +232,8 @@ - - + + diff --git a/pyvpn b/pyvpn index 532317f..4752155 100755 --- a/pyvpn +++ b/pyvpn @@ -31,12 +31,11 @@ if len(sys.argv) > 2: fScript.sendline(clientName) fScript.expect(pexpect.EOF) - if os.path.exists(configFilePath): file = open(configFilePath, 'r') - finalResult = base64.b64encode(file.read()) + finalResult = base64.b64encode(file.read().encode("utf-8")) sys.stdout.write(finalResult) sys.stdout.flush()