From 386e1a4f33ce240cea06ef0e7aa4d85dd1c9a104 Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Wed, 22 Jul 2015 21:07:11 +0300 Subject: [PATCH] Use configured FS encoding instead of the current locale --- reload_db.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/reload_db.py b/reload_db.py index 187bfb3..97012a8 100755 --- a/reload_db.py +++ b/reload_db.py @@ -12,9 +12,10 @@ __license__ = "GNU GPL" import sys from sqlobject import SQLObjectNotFound, sqlhub from sqlobject.sqlbuilder import Insert -from m_lib.defenc import default_encoding +from xsetbg_conf import xsetbg_conf from xsetbg_db import SqliteSequence, XSetBg, xsetbg_db +fs_encoding = xsetbg_conf.get("images", "fs_encoding") dump_file = open(sys.argv[1], 'rU') if xsetbg_db: @@ -49,8 +50,8 @@ for line in dump_file: id, timestamp, filename = line.strip().split(None, 2) id = convert_str(id) timestamp = convert_str(timestamp) - if default_encoding != 'utf-8': - filename = filename.decode(default_encoding).encode('utf-8') + if fs_encoding != 'utf-8': + filename = filename.decode(fs_encoding).encode('utf-8') values = {'last_shown': timestamp, 'full_name': filename} if id: values['id'] = id -- 2.39.2