unbork 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +8 -0
- data/Gemfile.lock +28 -0
- data/README.md +20 -0
- data/Rakefile +47 -0
- data/VERSION +1 -0
- data/lib/unbork.rb +30 -0
- data/lib/unmangle-utf8-script.sed +321 -0
- data/unbork.gemspec +68 -0
- metadata +123 -0
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
GEM
|
2
|
+
remote: http://rubygems.org/
|
3
|
+
specs:
|
4
|
+
gemcutter (0.7.1)
|
5
|
+
git (1.2.5)
|
6
|
+
jeweler (1.8.4)
|
7
|
+
bundler (~> 1.0)
|
8
|
+
git (>= 1.2.5)
|
9
|
+
rake
|
10
|
+
rdoc
|
11
|
+
json (1.7.7)
|
12
|
+
multi_json (1.7.2)
|
13
|
+
rake (10.0.4)
|
14
|
+
rdoc (4.0.0)
|
15
|
+
json (~> 1.4)
|
16
|
+
simplecov (0.7.1)
|
17
|
+
multi_json (~> 1.0)
|
18
|
+
simplecov-html (~> 0.7.1)
|
19
|
+
simplecov-html (0.7.1)
|
20
|
+
|
21
|
+
PLATFORMS
|
22
|
+
ruby
|
23
|
+
|
24
|
+
DEPENDENCIES
|
25
|
+
bundler
|
26
|
+
gemcutter
|
27
|
+
jeweler
|
28
|
+
simplecov
|
data/README.md
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
unbörk
|
2
|
+
======
|
3
|
+
|
4
|
+
Unmangles your UTF-8 encoded strings stored in MySQL's default Latin-1 Swedish encoding.
|
5
|
+
|
6
|
+
This is just a small wrapper around the concepts in [Rowan Thorpe's](http://rowanthorpe.wordpress.com/2012/10/15/unmangle-utf-8-from-double-encoded-utf-8-my-shell-script-and-batch-script-tweaks/) blog post, and includes a verbatim copy of his sed rules file.
|
7
|
+
|
8
|
+
Use it when working with legacy databases created with the wrong internal encodings. Fixing the database itself is always the best option, but it might be infeasible due to many reasons: downtime, legacy applications, lack of administrative access.
|
9
|
+
|
10
|
+
Includes most Latin scripts, Greek and some miscellaneous characters. Adding Cyryllic and other scripts should be fairly trivial.
|
11
|
+
|
12
|
+
|
13
|
+
Usage
|
14
|
+
-----
|
15
|
+
|
16
|
+
irb> t = User.find(...).full_name
|
17
|
+
"Bartek Urbański"
|
18
|
+
irb> require 'unbork'
|
19
|
+
irb> unbork t
|
20
|
+
"Bartek Urbański"
|
data/Rakefile
ADDED
@@ -0,0 +1,47 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
require 'rubygems'
|
3
|
+
require 'bundler'
|
4
|
+
begin
|
5
|
+
Bundler.setup(:default, :development)
|
6
|
+
rescue Bundler::BundlerError => e
|
7
|
+
$stderr.puts e.message
|
8
|
+
$stderr.puts "Run `bundle install` to install missing gems"
|
9
|
+
exit e.status_code
|
10
|
+
end
|
11
|
+
require 'rake'
|
12
|
+
|
13
|
+
require 'jeweler'
|
14
|
+
Jeweler::Tasks.new do |gem|
|
15
|
+
# gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
|
16
|
+
gem.name = "unbork"
|
17
|
+
gem.homepage = "http://github.com/k3rni/unbork"
|
18
|
+
gem.license = "MIT"
|
19
|
+
gem.summary = %Q{Unbörk your strings from MySQL's default Swedish encoding}
|
20
|
+
gem.description = %Q{Based on a blog post by Rowan Thorpe (http://rowanthorpe.wordpress.com/2012/10/15/unmangle-utf-8-from-double-encoded-utf-8-my-shell-script-and-batch-script-tweaks/), forcefully replaces broken UTF-8 encoded as pairs of Latin-1 characters. Includes a verbatim copy of Rowan's sed script. }
|
21
|
+
gem.email = "krzysztof.zych@connectmedica.com"
|
22
|
+
gem.authors = ["Krzysztof Zych"]
|
23
|
+
# Include your dependencies below. Runtime dependencies are required when using your gem,
|
24
|
+
# and development dependencies are only needed for development (ie running rake tasks, tests, etc)
|
25
|
+
# gem.add_runtime_dependency 'jabber4r', '> 0.1'
|
26
|
+
# gem.add_development_dependency 'rspec', '> 1.2.3'
|
27
|
+
end
|
28
|
+
Jeweler::RubygemsDotOrgTasks.new
|
29
|
+
|
30
|
+
require 'rake/testtask'
|
31
|
+
Rake::TestTask.new(:test) do |test|
|
32
|
+
test.libs << 'lib' << 'test'
|
33
|
+
test.pattern = 'test/**/test_*.rb'
|
34
|
+
test.verbose = true
|
35
|
+
end
|
36
|
+
|
37
|
+
task :default => :test
|
38
|
+
|
39
|
+
require 'rdoc/task'
|
40
|
+
Rake::RDocTask.new do |rdoc|
|
41
|
+
version = File.exist?('VERSION') ? File.read('VERSION') : ""
|
42
|
+
|
43
|
+
rdoc.rdoc_dir = 'rdoc'
|
44
|
+
rdoc.title = "unbork #{version}"
|
45
|
+
rdoc.rdoc_files.include('README*')
|
46
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
47
|
+
end
|
data/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
1.0.0
|
data/lib/unbork.rb
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
module Unbork
|
2
|
+
class << self
|
3
|
+
def swedish
|
4
|
+
@@swedish ||= learn_swedish
|
5
|
+
end
|
6
|
+
|
7
|
+
def learn_swedish
|
8
|
+
subst_filename = File.join(File.dirname(__FILE__), 'unmangle-utf8-script.sed')
|
9
|
+
swedish = {}
|
10
|
+
File.open(subst_filename).each do |line|
|
11
|
+
next if line =~ /latin1/
|
12
|
+
s, borked, unborked, g = line.split('/')
|
13
|
+
swedish[borked] = unborked
|
14
|
+
end
|
15
|
+
swedish
|
16
|
+
end
|
17
|
+
|
18
|
+
def swedish_letters
|
19
|
+
Regexp.union(swedish.keys)
|
20
|
+
end
|
21
|
+
|
22
|
+
def unbork text
|
23
|
+
text.gsub(swedish_letters, swedish)
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
def unbork text
|
29
|
+
Unbork.unbork text
|
30
|
+
end
|
@@ -0,0 +1,321 @@
|
|
1
|
+
s/=latin1/=utf8/g
|
2
|
+
s/α/α/g
|
3
|
+
s/β/β/g
|
4
|
+
s/γ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s/Ή/Ή/g
|
58
|
+
s/Ί/Ί/g
|
59
|
+
s/ÎŒ/Ό/g
|
60
|
+
s/ÎŽ/Ύ/g
|
61
|
+
s/Ï‹/ϋ/g
|
62
|
+
s/ΰ/ΰ/g
|
63
|
+
s/ÏŠ/ϊ/g
|
64
|
+
s/Ï‚/ς/g
|
65
|
+
s/Ï/ρ/g
|
66
|
+
s/Î/Ν/g
|
67
|
+
s/Î/Ώ/g
|
68
|
+
s/Î/ΐ/g
|
69
|
+
s/€/€/g
|
70
|
+
s/�/�/g
|
71
|
+
s/‚/‚/g
|
72
|
+
s/Æ’/ƒ/g
|
73
|
+
s/„/„/g
|
74
|
+
s/…/…/g
|
75
|
+
s/†/†/g
|
76
|
+
s/‡/‡/g
|
77
|
+
s/ˆ/ˆ/g
|
78
|
+
s/‰/‰/g
|
79
|
+
s/Å /Š/g
|
80
|
+
s/‹/‹/g
|
81
|
+
s/Å’/Œ/g
|
82
|
+
s/Ž/Ž/g
|
83
|
+
s/‘/‘/g
|
84
|
+
s/’/’/g
|
85
|
+
s/“/“/g
|
86
|
+
s/â€/”/g
|
87
|
+
s/•/•/g
|
88
|
+
s/–/–/g
|
89
|
+
s/—/—/g
|
90
|
+
s/Ëœ/˜/g
|
91
|
+
s/â„¢/™/g
|
92
|
+
s/Å¡/š/g
|
93
|
+
s/›/›/g
|
94
|
+
s/Å“/œ/g
|
95
|
+
s/ž/ž/g
|
96
|
+
s/Ÿ/Ÿ/g
|
97
|
+
s/¡/¡/g
|
98
|
+
s/¢/¢/g
|
99
|
+
s/£/£/g
|
100
|
+
s/¤/¤/g
|
101
|
+
s/Â¥/¥/g
|
102
|
+
s/¦/¦/g
|
103
|
+
s/§/§/g
|
104
|
+
s/¨/¨/g
|
105
|
+
s/©/©/g
|
106
|
+
s/ª/ª/g
|
107
|
+
s/«/«/g
|
108
|
+
s/¬/¬/g
|
109
|
+
s/Â//g
|
110
|
+
s/®/®/g
|
111
|
+
s/¯/¯/g
|
112
|
+
s/°/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/g
|
319
|
+
s/Ž/Ž/g
|
320
|
+
s/ž/ž/g
|
321
|
+
s/Ã/à/g
|
data/unbork.gemspec
ADDED
@@ -0,0 +1,68 @@
|
|
1
|
+
# Generated by jeweler
|
2
|
+
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
|
+
# -*- encoding: utf-8 -*-
|
5
|
+
|
6
|
+
Gem::Specification.new do |s|
|
7
|
+
s.name = %q{ffi-locale}
|
8
|
+
s.version = "0.1.2"
|
9
|
+
|
10
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
+
s.authors = ["Krzysztof Zych"]
|
12
|
+
s.date = %q{2011-09-28}
|
13
|
+
s.description = %q{Introduces C library's setlocale and strcoll functions in a thin
|
14
|
+
FFI wrapper.
|
15
|
+
}
|
16
|
+
s.email = %q{krzysztof.zych@redefine.pl}
|
17
|
+
s.extra_rdoc_files = [
|
18
|
+
"LICENSE.txt",
|
19
|
+
"README.md"
|
20
|
+
]
|
21
|
+
s.files = [
|
22
|
+
".document",
|
23
|
+
"Gemfile",
|
24
|
+
"LICENSE.txt",
|
25
|
+
"README.md",
|
26
|
+
"Rakefile",
|
27
|
+
"VERSION",
|
28
|
+
"ffi-locale.gemspec",
|
29
|
+
"lib/ffi-locale.rb",
|
30
|
+
"lib/ffi-locale/ffi-locale.rb",
|
31
|
+
"test/helper.rb",
|
32
|
+
"test/test_ffi-locale.rb"
|
33
|
+
]
|
34
|
+
s.homepage = %q{http://github.com/k3rni/ffi-locale}
|
35
|
+
s.licenses = ["MIT"]
|
36
|
+
s.require_paths = ["lib"]
|
37
|
+
s.rubygems_version = %q{1.6.2}
|
38
|
+
s.summary = %q{FFI wrapper over glibc locale functions}
|
39
|
+
s.test_files = [
|
40
|
+
"test/helper.rb",
|
41
|
+
"test/test_ffi-locale.rb"
|
42
|
+
]
|
43
|
+
|
44
|
+
if s.respond_to? :specification_version then
|
45
|
+
s.specification_version = 3
|
46
|
+
|
47
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
48
|
+
s.add_runtime_dependency(%q<ffi>, [">= 1.0.7"])
|
49
|
+
s.add_development_dependency(%q<shoulda>, [">= 0"])
|
50
|
+
s.add_development_dependency(%q<bundler>, ["~> 1.0.0"])
|
51
|
+
s.add_development_dependency(%q<jeweler>, ["~> 1.5.2"])
|
52
|
+
s.add_development_dependency(%q<rcov>, [">= 0"])
|
53
|
+
else
|
54
|
+
s.add_dependency(%q<ffi>, [">= 1.0.7"])
|
55
|
+
s.add_dependency(%q<shoulda>, [">= 0"])
|
56
|
+
s.add_dependency(%q<bundler>, ["~> 1.0.0"])
|
57
|
+
s.add_dependency(%q<jeweler>, ["~> 1.5.2"])
|
58
|
+
s.add_dependency(%q<rcov>, [">= 0"])
|
59
|
+
end
|
60
|
+
else
|
61
|
+
s.add_dependency(%q<ffi>, [">= 1.0.7"])
|
62
|
+
s.add_dependency(%q<shoulda>, [">= 0"])
|
63
|
+
s.add_dependency(%q<bundler>, ["~> 1.0.0"])
|
64
|
+
s.add_dependency(%q<jeweler>, ["~> 1.5.2"])
|
65
|
+
s.add_dependency(%q<rcov>, [">= 0"])
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
metadata
ADDED
@@ -0,0 +1,123 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: unbork
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.0
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Krzysztof Zych
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2013-03-27 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: gemcutter
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '0'
|
22
|
+
type: :development
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '0'
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: bundler
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
34
|
+
requirements:
|
35
|
+
- - ! '>='
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: '0'
|
38
|
+
type: :development
|
39
|
+
prerelease: false
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ! '>='
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: '0'
|
46
|
+
- !ruby/object:Gem::Dependency
|
47
|
+
name: jeweler
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
50
|
+
requirements:
|
51
|
+
- - ! '>='
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '0'
|
54
|
+
type: :development
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ! '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
- !ruby/object:Gem::Dependency
|
63
|
+
name: simplecov
|
64
|
+
requirement: !ruby/object:Gem::Requirement
|
65
|
+
none: false
|
66
|
+
requirements:
|
67
|
+
- - ! '>='
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '0'
|
70
|
+
type: :development
|
71
|
+
prerelease: false
|
72
|
+
version_requirements: !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
74
|
+
requirements:
|
75
|
+
- - ! '>='
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: '0'
|
78
|
+
description: ! 'Based on a blog post by Rowan Thorpe (http://rowanthorpe.wordpress.com/2012/10/15/unmangle-utf-8-from-double-encoded-utf-8-my-shell-script-and-batch-script-tweaks/),
|
79
|
+
forcefully replaces broken UTF-8 encoded as pairs of Latin-1 characters. Includes
|
80
|
+
a verbatim copy of Rowan''s sed script. '
|
81
|
+
email: krzysztof.zych@connectmedica.com
|
82
|
+
executables: []
|
83
|
+
extensions: []
|
84
|
+
extra_rdoc_files:
|
85
|
+
- README.md
|
86
|
+
files:
|
87
|
+
- Gemfile
|
88
|
+
- Gemfile.lock
|
89
|
+
- README.md
|
90
|
+
- Rakefile
|
91
|
+
- VERSION
|
92
|
+
- lib/unbork.rb
|
93
|
+
- lib/unmangle-utf8-script.sed
|
94
|
+
- unbork.gemspec
|
95
|
+
homepage: http://github.com/k3rni/unbork
|
96
|
+
licenses:
|
97
|
+
- MIT
|
98
|
+
post_install_message:
|
99
|
+
rdoc_options: []
|
100
|
+
require_paths:
|
101
|
+
- lib
|
102
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
103
|
+
none: false
|
104
|
+
requirements:
|
105
|
+
- - ! '>='
|
106
|
+
- !ruby/object:Gem::Version
|
107
|
+
version: '0'
|
108
|
+
segments:
|
109
|
+
- 0
|
110
|
+
hash: 469677885
|
111
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
112
|
+
none: false
|
113
|
+
requirements:
|
114
|
+
- - ! '>='
|
115
|
+
- !ruby/object:Gem::Version
|
116
|
+
version: '0'
|
117
|
+
requirements: []
|
118
|
+
rubyforge_project:
|
119
|
+
rubygems_version: 1.8.25
|
120
|
+
signing_key:
|
121
|
+
specification_version: 3
|
122
|
+
summary: Unbörk your strings from MySQL's default Swedish encoding
|
123
|
+
test_files: []
|