Skip to content

Commit

Permalink
Merge branch '61-stable' into 70-stable
Browse files Browse the repository at this point in the history
  • Loading branch information
enebo committed Mar 25, 2024
2 parents c81b7a9 + f918821 commit 1586190
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 43 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ Gem::Specification.new do |gem|
gem.files = `git ls-files`.split("\n") # assuming . working directory

gem.add_dependency 'activerecord-jdbc-adapter', "#{version}"
gem.add_dependency 'jdbc-sqlite3', '~> 3.8', '< 3.34'
gem.add_dependency 'jdbc-sqlite3', '~> 3.8'
end
85 changes: 43 additions & 42 deletions lib/arjdbc/mysql/connection_methods.rb
Original file line number Diff line number Diff line change
Expand Up @@ -126,51 +126,52 @@ def mariadb_connection(config)

private

@@mysql_encodings = nil
MYSQL_ENCODINGS = {
"big5" => "Big5",
"dec8" => nil,
#"cp850" => "Cp850",
"hp8" => nil,
#"koi8r" => "KOI8-R",
"latin1" => "Cp1252",
"latin2" => "ISO8859_2",
"swe7" => nil,
"ascii" => "US-ASCII",
"ujis" => "EUC_JP",
"sjis" => "SJIS",
"hebrew" => "ISO8859_8",
"tis620" => "TIS620",
"euckr" => "EUC_KR",
#"koi8u" => "KOI8-R",
"gb2312" => "EUC_CN",
"greek" => "ISO8859_7",
"cp1250" => "Cp1250",
"gbk" => "GBK",
#"latin5" => "ISO-8859-9",
"armscii8" => nil,
"ucs2" => "UnicodeBig",
"cp866" => "Cp866",
"keybcs2" => nil,
"macce" => "MacCentralEurope",
"macroman" => "MacRoman",
#"cp852" => "CP852",
#"latin7" => "ISO-8859-13",
"cp1251" => "Cp1251",
"cp1256" => "Cp1256",
"cp1257" => "Cp1257",
"binary" => false,
"geostd8" => nil,
"cp932" => "Cp932",
#"eucjpms" => "eucJP-ms"
"utf8" => "UTF-8",
"utf8mb4" => false,
"utf16" => false,
"utf32" => false,
}


# @see https://dev.mysql.com/doc/connector-j/5.1/en/connector-j-reference-charsets.html
def convert_mysql_encoding(encoding) # to charset-name (characterEncoding=...)
( @@mysql_encodings ||= {
"big5" => "Big5",
"dec8" => nil,
#"cp850" => "Cp850",
"hp8" => nil,
#"koi8r" => "KOI8-R",
"latin1" => "Cp1252",
"latin2" => "ISO8859_2",
"swe7" => nil,
"ascii" => "US-ASCII",
"ujis" => "EUC_JP",
"sjis" => "SJIS",
"hebrew" => "ISO8859_8",
"tis620" => "TIS620",
"euckr" => "EUC_KR",
#"koi8u" => "KOI8-R",
"gb2312" => "EUC_CN",
"greek" => "ISO8859_7",
"cp1250" => "Cp1250",
"gbk" => "GBK",
#"latin5" => "ISO-8859-9",
"armscii8" => nil,
"ucs2" => "UnicodeBig",
"cp866" => "Cp866",
"keybcs2" => nil,
"macce" => "MacCentralEurope",
"macroman" => "MacRoman",
#"cp852" => "CP852",
#"latin7" => "ISO-8859-13",
"cp1251" => "Cp1251",
"cp1256" => "Cp1256",
"cp1257" => "Cp1257",
"binary" => false,
"geostd8" => nil,
"cp932" => "Cp932",
#"eucjpms" => "eucJP-ms"
"utf8" => "UTF-8",
"utf8mb4" => false,
"utf16" => false,
"utf32" => false,
} )[ encoding ]
MYSQL_ENCODINGS[ encoding ]
end

end

0 comments on commit 1586190

Please sign in to comment.