immosquare-extensions 0.1.15 → 0.1.16
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/immosquare-extensions/file.rb +3 -2
- data/lib/immosquare-extensions/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e917d43fa0c52a52495031fcf8918d689411b68265a0b95eb87c5646797c6926
|
4
|
+
data.tar.gz: c78f61c33ee2afe225db23c232e2b413b754c482a0851a9fe6ed536721b507dc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1eba48121714cdfe6de72216ef5f46067005ba1ed272e7f0bc22f92db2423bb897469d60aa940c701c9f713f9927bc6daa47bfa94ed242276d401b6635f603ae
|
7
|
+
data.tar.gz: e8b7307de7f4006f3135287624ef8cb863d7e0d55920d87046eb1fd52ac8ee3a5752d8154e0516d701bc8456538007b00e038d8779f92197e16f3b989d4bcdf9
|
@@ -33,7 +33,7 @@ class File
|
|
33
33
|
## Read the content of the file with the detected encoding,
|
34
34
|
## falling back to UTF-8 if the detected encoding is empty or invalid.
|
35
35
|
##============================================================##
|
36
|
-
detected_encoding = `uchardet #{file_path}`.strip
|
36
|
+
detected_encoding = `uchardet #{file_path}`.strip.to_s.upcase
|
37
37
|
encoding_whitelist = [
|
38
38
|
"UTF-8", # Encodage universel pour texte avec ou sans accents
|
39
39
|
"Windows-1252", # Utilisé couramment pour les langues occidentales
|
@@ -64,7 +64,8 @@ class File
|
|
64
64
|
"UTF-16BE", # UTF-16 Big Endian
|
65
65
|
"UTF-32LE", # UTF-32 Little Endian
|
66
66
|
"UTF-32BE" # UTF-32 Big Endian
|
67
|
-
]
|
67
|
+
].map(&:upcase)
|
68
|
+
|
68
69
|
|
69
70
|
|
70
71
|
encoding_to_use = detected_encoding.empty? || !encoding_whitelist.include?(detected_encoding) ? "UTF-8" : "#{detected_encoding}:UTF-8"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: immosquare-extensions
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.16
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- IMMO SQUARE
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-03-
|
11
|
+
date: 2024-03-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: unicode_utils
|