Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
Metabase
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Engineering Digital Service
Metabase
Commits
5830d8dc
Unverified
Commit
5830d8dc
authored
6 months ago
by
Chris Truter
Committed by
GitHub
6 months ago
Browse files
Options
Downloads
Patches
Plain Diff
Tidy up CSV encoding detection (#47809)
parent
56d21640
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
deps.edn
+1
-0
1 addition, 0 deletions
deps.edn
src/metabase/upload.clj
+4
-6
4 additions, 6 deletions
src/metabase/upload.clj
with
5 additions
and
6 deletions
deps.edn
+
1
−
0
View file @
5830d8dc
...
@@ -36,6 +36,7 @@
...
@@ -36,6 +36,7 @@
:exclusions
[
it.unimi.dsi/fastutil
:exclusions
[
it.unimi.dsi/fastutil
org.slf4j/slf4j-api
]}
org.slf4j/slf4j-api
]}
com.draines/postal
{
:mvn/version
"2.0.5"
}
; SMTP library
com.draines/postal
{
:mvn/version
"2.0.5"
}
; SMTP library
; Detect the charset in uploaded CSV files
com.github.albfernandez/juniversalchardet
{
:mvn/version
"2.5.0"
}
com.github.albfernandez/juniversalchardet
{
:mvn/version
"2.5.0"
}
com.github.seancorfield/honeysql
{
:mvn/version
"2.6.1126"
}
; Honey SQL 2. SQL generation from Clojure data maps
com.github.seancorfield/honeysql
{
:mvn/version
"2.6.1126"
}
; Honey SQL 2. SQL generation from Clojure data maps
com.github.seancorfield/next.jdbc
{
:mvn/version
"1.3.925"
}
; Talk to JDBC DBs
com.github.seancorfield/next.jdbc
{
:mvn/version
"1.3.925"
}
; Talk to JDBC DBs
...
...
This diff is collapsed.
Click to expand it.
src/metabase/upload.clj
+
4
−
6
View file @
5830d8dc
...
@@ -291,16 +291,14 @@
...
@@ -291,16 +291,14 @@
(
if
(
pos?
bytes-read
)
(
if
(
pos?
bytes-read
)
(
do
(
do
(
.handleData
detector
buffer
0
bytes-read
)
(
.handleData
detector
buffer
0
bytes-read
)
(
if
(
.isDone
detector
)
(
when-not
(
.isDone
detector
)
(
.getDetectedCharset
detector
)
(
recur
)))
(
recur
)))
(
do
(
.dataEnd
detector
)))))
(
.dataEnd
detector
)
(
.getDetectedCharset
detector
))
(
.getDetectedCharset
detector
)))))))
(
catch
Exception
_
)))
(
catch
Exception
_
)))
(
defn-
->reader
^
Reader
[
^
File
file
]
(
defn-
->reader
^
Reader
[
^
File
file
]
;;
J
ust live with unrecognized characters
;;
If we can't detect the encoding, j
ust live with unrecognized characters
.
(
let
[
charset
(
or
(
detect-charset
file
)
"UTF-8"
)]
(
let
[
charset
(
or
(
detect-charset
file
)
"UTF-8"
)]
(
->
(
bom/bom-input-stream
file
)
(
->
(
bom/bom-input-stream
file
)
(
InputStreamReader.
charset
))))
(
InputStreamReader.
charset
))))
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment