Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
haskell-gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
120
Issues
120
List
Board
Labels
Milestones
Merge Requests
7
Merge Requests
7
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gargantext
haskell-gargantext
Commits
5bdb077b
Commit
5bdb077b
authored
Nov 13, 2023
by
Alfredo Di Napoli
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Force server locale to be UTF-8
parent
ccde5822
Pipeline
#5351
passed with stages
in 73 minutes and 40 seconds
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
1 deletion
+12
-1
Main.hs
bin/gargantext-phylo/Main.hs
+4
-0
Main.hs
bin/gargantext-server/Main.hs
+8
-1
No files found.
bin/gargantext-phylo/Main.hs
View file @
5bdb077b
...
...
@@ -26,6 +26,7 @@ import Data.Maybe (fromJust)
import
Data.Text
(
unpack
,
replace
,
pack
)
import
Data.Text
qualified
as
T
import
Data.Vector
qualified
as
Vector
import
GHC.IO.Encoding
import
Gargantext.API.Ngrams.Prelude
(
toTermList
)
import
Gargantext.API.Ngrams.Types
import
Gargantext.Core.Text.Context
(
TermList
)
...
...
@@ -253,6 +254,9 @@ fileToList parser path =
main
::
IO
()
main
=
do
setLocaleEncoding
utf8
currentLocale
<-
getLocaleEncoding
printIOMsg
$
"Machine locale: "
<>
show
currentLocale
printIOMsg
"Starting the reconstruction"
printIOMsg
"Read the configuration file"
...
...
bin/gargantext-server/Main.hs
View file @
5bdb077b
...
...
@@ -28,6 +28,7 @@ import Gargantext.API (startGargantext) -- , startGargantextMock)
import
Gargantext.API.Admin.EnvTypes
import
Gargantext.Prelude
import
Gargantext.System.Logging
import
GHC.IO.Encoding
import
Options.Generic
import
System.Exit
(
exitSuccess
)
import
qualified
Paths_gargantext
as
PG
-- cabal magic build module
...
...
@@ -54,6 +55,11 @@ deriving instance Show (MyOptions Unwrapped)
main
::
IO
()
main
=
withLogger
()
$
\
ioLogger
->
do
-- Sets the locale to avoid encoding issues like in #284.
setLocaleEncoding
utf8
currentLocale
<-
getLocaleEncoding
MyOptions
myMode
myPort
myIniFile
myVersion
<-
unwrapRecord
"Gargantext server"
---------------------------------------------------------------
...
...
@@ -76,5 +82,6 @@ main = withLogger () $ \ioLogger -> do
Mock
->
panic
"[ERROR] Mock mode unsupported"
_
->
startGargantext
myMode
myPort'
(
unpack
myIniFile'
)
logMsg
ioLogger
INFO
$
"Starting with "
<>
show
myMode
<>
" mode."
logMsg
ioLogger
INFO
$
"Machine locale: "
<>
show
currentLocale
start
---------------------------------------------------------------
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment