From ee783f94b4ecd27a0978a782b1b686ee0aaddc2b Mon Sep 17 00:00:00 2001 From: Orhun Aysan Date: Tue, 27 Aug 2024 09:52:47 +0300 Subject: [PATCH 1/2] fixed hardcoded locale and updated the python setup file --- .gitignore | 1 + jamspell/utils.cpp | 4 ++-- setup.py | 6 +++--- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index b958c6b..fcab859 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ .idea/ +.venv/ *.pyc *.aff *.dic diff --git a/jamspell/utils.cpp b/jamspell/utils.cpp index 07ad2c7..19efe9a 100644 --- a/jamspell/utils.cpp +++ b/jamspell/utils.cpp @@ -32,7 +32,7 @@ void SaveFile(const std::string& fileName, const std::string& data) { } TTokenizer::TTokenizer() - : Locale("en_US.utf-8") + : Locale(std::locale::classic()) { } @@ -135,7 +135,7 @@ uint64_t GetCurrentTimeMs() { return ms.count(); } -static const std::locale GLocale("en_US.UTF-8"); +static const std::locale GLocale(std::locale::classic()); static const std::ctype& GWctype = std::use_facet>(GLocale); void ToLower(std::wstring& text) { diff --git a/setup.py b/setup.py index b207806..84ebef8 100644 --- a/setup.py +++ b/setup.py @@ -1,9 +1,9 @@ import os import sys -from distutils.command.build import build -from distutils.command.build_ext import build_ext +from setuptools.command.build import build +from setuptools.command.build_ext import build_ext from setuptools.command.install import install -from distutils.spawn import find_executable +from shutil import which as find_executable from setuptools import setup from setuptools.extension import Extension import subprocess From 28bb2f7448ea86bf3accc91c736608ffd9806add Mon Sep 17 00:00:00 2001 From: Orhun Aysan <91375826+aysanorhun@users.noreply.github.com> Date: Wed, 28 Aug 2024 17:16:51 +0300 Subject: [PATCH 2/2] Update .gitignore --- .gitignore | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitignore b/.gitignore index fcab859..b958c6b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,4 @@ .idea/ -.venv/ *.pyc *.aff *.dic