summaryrefslogtreecommitdiffstats
path: root/debian/patches/workarounds/0001-Workaround-989814.patch
blob: aac9c940f8fec7c2cf1e8c1f112434d9daece096 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
From 82880587b3a578d61e8335199f316e6794750ba6 Mon Sep 17 00:00:00 2001
From: Vasyl Gello <vasek.gello@gmail.com>
Date: Fri, 25 Jun 2021 01:37:02 +0000
Subject: [PATCH 1/2] Check if applied locale correctly lowers chars and
 fallback

.. to default region if it does not.

Fixes #19883.

Signed-off-by: Vasyl Gello <vasek.gello@gmail.com>
---
 xbmc/LangInfo.cpp | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/xbmc/LangInfo.cpp b/xbmc/LangInfo.cpp
index 24f0419cfe..1c93ebf440 100644
--- a/xbmc/LangInfo.cpp
+++ b/xbmc/LangInfo.cpp
@@ -981,6 +981,18 @@ void CLangInfo::SetCurrentRegion(const std::string& strName)
 
   m_currentRegion->SetGlobalLocale();
 
+  // Check if locale is affected by "Turkish I"
+  // See https://github.com/xbmc/xbmc/issue/19883 for details
+  if (std::tolower('i') != std::tolower('I'))
+  {
+    CLog::Log(
+        LOGWARNING,
+        "region '{}' is affected by 'Turkish I' problem - falling back to default region '{}'",
+        m_currentRegion->m_strName, m_defaultRegion.m_strName);
+    m_currentRegion = &m_defaultRegion;
+    m_currentRegion->SetGlobalLocale();
+  }
+
   const std::shared_ptr<CSettings> settings = CServiceBroker::GetSettingsComponent()->GetSettings();
   if (settings->GetString(CSettings::SETTING_LOCALE_SHORTDATEFORMAT) == SETTING_REGIONAL_DEFAULT)
     SetShortDateFormat(m_currentRegion->m_strDateFormatShort);
-- 
2.33.0


From 2be9ed286e1478c7b1a3002242330b6101492621 Mon Sep 17 00:00:00 2001
From: Vasyl Gello <vasek.gello@gmail.com>
Date: Sun, 27 Jun 2021 19:31:39 +0000
Subject: [PATCH 2/2] kodi.sh.in: Unset LC_{ALL,CTYPE}, LANG

Signed-off-by: Vasyl Gello <vasek.gello@gmail.com>
---
 tools/Linux/kodi.sh.in | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/tools/Linux/kodi.sh.in b/tools/Linux/kodi.sh.in
index 108c0b007b..b148fd49ee 100644
--- a/tools/Linux/kodi.sh.in
+++ b/tools/Linux/kodi.sh.in
@@ -171,6 +171,11 @@ if command_exists gdb; then
   fi
 fi
 
+
+# Check if locale is affected by "Turkish I"
+# See https://github.com/xbmc/xbmc/issue/19883 for details
+unset LC_CTYPE LC_ALL LANG
+
 LOOP=1
 while [ $(( $LOOP )) = "1" ]
 do
-- 
2.33.0