Przeglądaj źródła

Fix: Improve TimeSeparator detection in FormatSettings for CJK locales

Zhan Wang 1 miesiąc temu
rodzic
commit
9b3ebb91d0
1 zmienionych plików z 4 dodań i 1 usunięć
  1. 4 1
      packages/rtl-extra/src/unix/clocale.pp

+ 4 - 1
packages/rtl-extra/src/unix/clocale.pp

@@ -158,7 +158,10 @@ procedure GetFormatSettings(out fmts: TFormatSettings);
     inc(i);
     SkipModifiers(s, i);
     inc(i);
-    if i<=Length(s) then
+    // Only accept common ASCII separators, such as ':', '.', '-', etc.
+    // Skip CJK-style language-specific date/time units like "时", "分", "초", "년".
+    // e.g. skip "14时05分30秒" or "2024년6월19일"
+    if (i<=Length(s)) and (s[i] in [':', '.', '-', '/', ' ', '_']) then
       FindSeparator := s[i];
   end;