mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
py3: Fix unicode spaces being replaced by normal space in the edit metadata dialog
Fixes #1863525 [IDEOGRAPHIC SPACE (U+3000) is not treated correctly](https://bugs.launchpad.net/calibre/+bug/1863525)
This commit is contained in:
parent
351781e869
commit
936e8b6382
@ -30,6 +30,7 @@ from calibre.utils.date import (
|
||||
local_tz, qt_to_dt, as_local_time, UNDEFINED_DATE, is_date_undefined,
|
||||
utcfromtimestamp, parse_only_date, internal_iso_format_string)
|
||||
from calibre import strftime
|
||||
from calibre.constants import ispy3
|
||||
from calibre.ebooks import BOOK_EXTENSIONS
|
||||
from calibre.customize.ui import run_plugins_on_import
|
||||
from calibre.gui2.comments_editor import Editor
|
||||
@ -52,7 +53,7 @@ def save_dialog(parent, title, msg, det_msg=''):
|
||||
|
||||
|
||||
def clean_text(x):
|
||||
return re.sub(r'\s', ' ', x.strip())
|
||||
return re.sub(r'\s', ' ', x.strip(), flags=re.ASCII if ispy3 else 0)
|
||||
|
||||
|
||||
'''
|
||||
@ -221,7 +222,6 @@ class TitleEdit(EnLineEdit, ToMetadataMixin):
|
||||
|
||||
@property
|
||||
def current_val(self):
|
||||
|
||||
title = clean_text(unicode_type(self.text()))
|
||||
if not title:
|
||||
title = self.get_default()
|
||||
|
Loading…
x
Reference in New Issue
Block a user