Add opition 'encoding' to set encoding of the input file. Panel.substitutions files for dm2k, edm are coded in latin. (bin/CreatePanel.py)
Warning, cannot access the index:
_darcs/index: opening of '_darcs/index' failed: permission denied (Permission denied)
diff -rN -u old-bii_scripts/bin/CreatePanel.py new-bii_scripts/bin/CreatePanel.py
--- old-bii_scripts/bin/CreatePanel.py 2022-11-28 22:56:23.537905618 +0100
+++ new-bii_scripts/bin/CreatePanel.py 2022-11-28 22:56:23.537905618 +0100
@@ -924,9 +924,9 @@
#-------- get substitutions data
if opts['inFile'] != "-":
- f= open(opts['inFile'], "r")
+ f= open(opts['inFile'], "r",encoding=opts['encoding'])
else:
- #sys.stderr.write("(expect input from stdin)\n")
+ print("(expect input from stdin)\n")
f= sys.stdin
substFileStr= f.read()
if opts['inFile'] != "-":
@@ -1011,6 +1011,11 @@
type="string",
help="see spaceing. For compatibility to CreatePanel.pl option",
)
+ parser.add_option("--encoding",
+ action="store",
+ type="string",
+ help="Input file encoding, default: utf8. Files for edm, medm: latin",
+ )
parser.add_option("-I",
action="append",
type="string",
@@ -1082,6 +1087,10 @@
except ValueError:
sys.stderr.write("ERROR: missing argument for in-, out-file:"+str(args))
sys.exit(1)
+ opts['encoding'] = 'utf8'
+ if options.encoding:
+ opts['encoding'] = options.encoding
+
opts['verbose'] = False
if options.verbose:
print("READ: ",opts['inFile'],"WRITE:",opts['outFile'])
patch d8e626aed46457da78d70593bb7d874a5695d8a1
Author: Bernhard.Kuner@bessy.de
Date: Wed Jun 23 12:34:39 CEST 2021
* Add opition 'encoding' to set encoding of the input file. Panel.substitutions files for dm2k, edm are coded in latin. (bin/CreatePanel.py