use 5.014;
use warnings;
use utf8;

+{
	default    => [qw( u+0-27F utf8+realsize iso-8859-1 iso-8859-15 cp1252 cp437 cp850 )],
	unicode    => [qw( uu+cols=32+realsize u+0-FFF u+1000-18AF u+18B0-1FFF )],
	us         => [qw( cp437 cp863 gsm0338 AdobeStandardEncoding )],
	ebcdic     => [qw( cp37 cp500 cp1047 posix-bc cp1026 cp875 )],
	iso        => [map {"iso-8859-$_"} 1 .. 11, 13 .. 16],
	dos        => [qw( cp437 cp865 cp861 cp860 cp863 cp850 cp857 cp852 cp775
	                   cp737 cp869 cp866 MIK cp855 cp862 cp864 )],
	aix        => [qw( cp1006 )],
	win        => [qw( cp1252 cp1250 cp1254 cp1257 cp1258 cp1253 cp1251 cp1255 cp1256 cp874 )],
	mac        => [qw( MacRoman MacRomanian MacRumanian MacCroatian MacCentralEurRoman MacTurkish MacIcelandic MacSami
	                   MacGreek MacCyrillic MacHebrew MacArabic MacFarsi MacThai )],

	# languages
	westeur    => [qw( iso-8859-1 iso-8859-15 cp1252 iso-8859-14 cp850 hp-roman8 nextstep MacRoman )],
	centeur    => [qw( iso-8859-2 iso-8859-16 cp1250 cp852 MacRomanian MacCroatian MacCentralEurRoman )], # MacRumanian only for DB
	turkish    => [qw( iso-8859-9 iso-8859-3 cp1254 cp857 MacTurkish )],
	norteur    => [qw( baltic nordic )],
	baltic     => [qw( iso-8859-4 iso-8859-13 cp1257 cp775 )],
	nordic     => [qw( iso-8859-10 cp865 cp861 MacIcelandic MacSami )],
	cyrillic   => [qw( koi8-r koi8-u koi8-f iso-8859-5 cp1251 MacCyrillic cp866 MIK cp855
	                   +400 +2DE0 +A640-A69F +500-52F )], # MacUkrainian is broken
	arabic     => [qw( iso-8859-6 cp1256 MacArabic cp864 cp1006 MacFarsi
	                   +600 +8A0-8BF+8E0 +750-77F )],
	greek      => [qw( iso-8859-7 cp1253 MacGreek cp737 cp869  +370 +1F00 )],
	hebrew     => [qw( iso-8859-8 cp1255 MacHebrew cp862  +590 )],
	thai       => [qw( iso-8859-11 cp874 MacThai )], # U+0E00 identical to iso-8859-11
	vietnamese => [qw( viscii cp1258 MacVietnamese )],
	symbols    => [qw( symbol dingbats MacDingbats wingdings wingdings2 wingdings3 webdings )],

	# iso-code shorthand
	1 => 'westeur',
	2 => 'centeur',
	3 => 'turkish',
	4 => 'baltic',
	5 => 'cyrillic',
	6 => 'arabic',
	7 => 'greek',
	8 => 'hebrew',
	9 => 'turkish',
	10 => 'nordic',
	11 => 'thai',

	'ascii'        => {inherit => ['' => '00-7F']},
	'cp437'        => {
		inherit => ['cp850' => 0, 'ascii' => '00-1F+80'], # ascii range overridden later
		replace => {
			0    => ' ☺☻♥♦♣♠•◘○◙♂♀♪♫☼►◄↕‼¶§▬↨↑↓→←∟↔▲▼', # visible variants of control characters
			0xED => 'ϕ', # non-greek usage and appearance
		},
	},
	'gsm0338'      => {inherit => ['ascii' => '00-7F']},
	'dingbats'     => {inherit => ['' => '20-7F+A0']},
	'macdingbats'  => {inherit => ['dingbats' => '80-9F']},
	'adobezdingbat'=> {inherit => ['MacDingbats' => '80-9F']}, # should be identical but maps to private use
	'symbol'       => {
		inherit => ['' => '20-7F+A0'],
		replace => {
			0x60 => '│', # replace radical extender by closest unicode equivalent
			0xBD => '⏐⎯', # arrow extenders
			0xD2 => '®©™', # serif variants
			0xE0 => '◊', # replace lookalike, should match AdobeSymbol
			0xE2 => '®©™', # sans-serif variants
			0xE6 => '⎛⎜⎝⎡⎢⎣⎧⎨⎩⎪',
			0xF0 => '€',
			0xF4 => '⎮⌡⎞⎟⎠⎤⎥⎦⎫⎬⎭',
		},
	},
	'adobesymbol'  => {inherit => ['symbol' => '20-7F+A0', '' => '20-7F+A0']}, # minor differences, irrelevant except for different '€'
	'wingdings'    => {inherit => ['' => '20'], setup => sub {
		$_[0]->{table} = [(map {chr} 0 .. 0x20), qw(
			  🖉 ✂ ✁ 👓 🕭 🕮 🕯 🕿 ✆ 🖂 🖃 📪 📫 📬 📭 📁 📂 📄 🗏 🗐 🗄 ⌛ 🖮 🖰 🖲 🖳 🖴 🖫 🖬 ✇ ✍
			🖎 ✌ 👌 👍 👎 ☜ ☞ ☝ ☟ 🖐 ☺ 😐 ☹ 💣 ☠ 🏳 🏱 ✈ ☼ 💧 ❄ 🕆 ✞ 🕈 ✠ ✡ ☪ ☯ ॐ ☸ ♈ ♉
			♊ ♋ ♌ ♍ ♎ ♏ ♐ ♑ ♒ ♓ 🙰 🙵 ● 🔾 ■ □ 🞐 ❑ ❒ ⬧ ⧫ ◆ ❖ ⬥ ⌧ ⮹ ⌘ 🏵 🏶 🙶 🙷 
			⓪ ① ② ③ ④ ⑤ ⑥ ⑦ ⑧ ⑨ ⑩ ⓿ ❶ ❷ ❸ ❹ ❺ ❻ ❼ ❽ ❾ ❿ 🙢 🙠 🙡 🙣 🙞 🙜 🙝 🙟 · •
			▪ ⚪ 🞆 🞈 ◉ ◎ 🔿 ▪ ◻ 🟂 ✦ ★ ✶ ✴ ✹ ✵ ⯐ ⌖ ⟡ ⌑ ⯑ ✪ ✰ 🕐 🕑 🕒 🕓 🕔 🕕 🕖 🕗 🕘
			🕙 🕚 🕛 ⮰ ⮱ ⮲ ⮳ ⮴ ⮵ ⮶ ⮷ 🙪 🙫 🙕 🙔 🙗 🙖 🙐 🙑 🙒 🙓 ⌫ ⌦ ⮘ ⮚ ⮙ ⮛ ⮈ ⮊ ⮉ ⮋ 🡨
			🡪 🡩 🡫 🡬 🡭 🡯 🡮 🡸 🡺 🡹 🡻 🡼 🡽 🡿 🡾 ⇦ ⇨ ⇧ ⇩ ⬄ ⇳ ⬀ ⬁ ⬃ ⬂ 🢬 🢭 🗶 ✔ 🗷 🗹 
		)];
	}},
	'wingdings2'   => {inherit => ['' => '20'], setup => sub {
		$_[0]->{table} = [(map {chr} 0 .. 0x20), qw(
			  🖊 🖋 🖌 🖍 ✄ ✀ 🕾 🕽 🗅 🗆 🗇 🗈 🗉 🗊 🗋 🗌 🗍 📋 🗑 🗔 🖵 🖶 🖷 🖸 🖭 🖯 🖱 🖒 🖓 🖘 🖙
			🖚 🖛 👈 👉 🖜 🖝 🖞 🖟 🖠 🖡 👆 👇 🖢 🖣 🖑 🗴 ✓ 🗵 ☑ ☒ ☒ ⮾ ⮿ ⦸ ⦸ 🙱 🙴 🙲 🙳 ‽ 🙹 🙺
			🙻 🙦 🙤 🙥 🙧 🙚 🙘 🙙 🙛 ⓪ ① ② ③ ④ ⑤ ⑥ ⑦ ⑧ ⑨ ⑩ ⓿ ❶ ❷ ❸ ❹ ❺ ❻ ❼ ❽ ❾ ❿ 
			☉ 🌕 ☽ ☾ ⸿ ✝ 🕇 🕜 🕝 🕞 🕟 🕠 🕡 🕢 🕣 🕤 🕥 🕦 🕧 🙨 🙩 • ● ⚫ ⬤ 🞅 🞆 🞇 🞈 🞊 ⦿ ◾
			■ ◼ ⬛ ⬜ 🞑 🞒 🞓 🞔 ▣ 🞕 🞖 🞗 ⬩ ⬥ ◆ ◇ 🞚 ◈ 🞛 🞜 🞝 ⬪ ⬧ ⧫ ◊ 🞠 ◖ ◗ ⯊ ⯋ ◼ ⬥
			⬟ ⯂ ⬣ ⬢ ⯃ ⯄ 🞡 🞢 🞣 🞤 🞥 🞦 🞧 🞨 🞩 🞪 🞫 🞬 🞭 🞮 🞯 🞰 🞱 🞲 🞳 🞴 🞵 🞶 🞷 🞸 🞹 🞺
			🞻 🞼 🞽 🞾 🞿 🟀 🟂 🟄 ✦ 🟉 ★ ✶ 🟋 ✷ 🟏 🟒 ✹ 🟃 🟇 ✯ 🟍 🟔 ⯌ ⯍ ※ ⁂
		)];
	}},
	'wingdings3'   => {inherit => ['' => '20'], setup => sub {
		$_[0]->{table} = [(map {chr} 0 .. 0x20), qw(
			  ⭠ ⭢ ⭡ ⭣ ⭦ ⭧ ⭩ ⭨ ⭰ ⭲ ⭱ ⭳ ⭶ ⭸ ⭻ ⭽ ⭤ ⭥ ⭪ ⭬ ⭫ ⭭ ⭍ ⮠ ⮡ ⮢ ⮣ ⮤ ⮥ ⮦ ⮧
			⮐ ⮑ ⮒ ⮓ ⮀ ⮃ ⭾ ⭿ ⮄ ⮆ ⮅ ⮇ ⮏ ⮍ ⮎ ⮌ ⭮ ⭯ ⎋ ⌤ ⌃ ⌥ ⎵ ⏡ ⇪ ⮸ 🢠 🢡 🢢 🢣 🢤 🢥
			🢦 🢧 🢨 🢩 🢪 🢫 ← → ↑ ↓ ↖ ↗ ↙ ↘ 🡘 🡙 ▲ ▼ △ ▽ ◄ ► ◁ ▷ ◣ ◢ ◤ ◥ 🞀 🞂 🞁 
			🞃 ▲ ▼ ◀ ▶ ⮜ ⮞ ⮝ ⮟ 🠐 🠒 🠑 🠓 🠔 🠖 🠕 🠗 🠘 🠚 🠙 🠛 🠜 🠞 🠝 🠟 🠀 🠂 🠁 🠃 🠄 🠆 🠅
			🠇 🠈 🠊 🠉 🠋 🠠 🠢 🠤 🠦 🠨 🠨 🠪 🢜 🢝 🢞 🢟 🠮 🠰 🠲 🠴 🠶 🠸 🠺 🠹 🠻 🢘 🢚 🢙 🢛 🠼 🠾 🠽
			🠿 🡀 🡂 🡁 🡃 🡄 🡆 🡅 🡇 ⮨ ⮩ ⮪ ⮫ ⮬ ⮭ ⮮ ⮯ 🡠 🡢 🡡 🡣 🡤 🡥 🡧 🡦 🡰 🡲 🡱 🡳 🡴 🡵 🡷
			🡶 🢀 🢂 🢁 🢃 🢄 🢅 🢇 🢆 🢐 🢒 🢑 🢓 🢔 🢖 🢕 🢗
		)];
	}},
	'webdings'     => {inherit => ['' => '20'], setup => sub {
		$_[0]->{table} = [(map {chr} 0 .. 0x20), qw(
			  🕷 🕸 🕲 🕶 🏆 🎖 🖇 🗨 🗩 🗰 🗱 🌶 🎗 ▞ 🙼 🗕 🗖 🗗 ⏴ ⏵ ⏶ ⏷ ⏪ ⏩ ⏮ ⏭ ⏸ ⏹ ⏺ 🗚 🗳
			🛠 🏗 🏘 🏙 🏚 🏜 🏭 🏛 🏠 🏖 🏝 🛣 🔍 🏔 👁 👂 🏞 🏕 🛤 🏟 🛳 🕬 🕫 🕨 🔈 🎔 🎕 🗬 🙽 🗭 🗪 🗫
			⮔ ✔ 🚲 □ 🛡 📦 🛱 ■ 🚑 🛈 🛩 🛰 🟈 🕴 ⚫ 🛥 🚔 🗘 🗙 ❓ 🛲 🚇 🚍 ⛳ 🛇 ⊖ 🚭 🗮 | 🗯 🗲 
			🚹 🚺 🛉 🛊 🚼 👽 🏋 ⛷ 🏂 🏌 🏊 🏄 🏍 🏎 🚘 🗠 🛢 💰 🏷 💳 👪 🗡 🗢 🗣 ✯ 🖄 🖅 🖃 🖆 🖹 🖺 🖻
			🕵 🕰 🖽 🖾 📋 🗒 🗓 📖 📚 🗞 🗟 🗃 🗂 🖼 🎭 🎜 🎘 🎙 🎧 💿 🎞 📷 🎟 🎬 📽 📹 📾 📻 🎚 🎛 📺 💻
			🖥 🖦 🖧 🕹 🎮 🕻 🕼 📟 🖁 🖀 🖨 🖩 🖿 🖪 🗜 🔒 🔓 🗝 📥 📤 🕳 🌣 🌤 🌥 🌦 ☁ 🌧 🌨 🌩 🌪 🌬 🌫
			🌜 🌡 🛋 🛏 🍽 🍸 🛎 🛍 Ⓟ ♿ 🛆 🖈 🎓 🗤 🗥 🗦 🗧 🛪 🐿 🐦 🐟 🐕 🐈 🙬 🙮 🙭 🙯 🗺 🌍 🌏 🌎 🕊
		)];
	}},

	'iso-8859-2'   => {inherit => ['iso-8859-1' => 'A0']},
	'iso-8859-3'   => {inherit => ['iso-8859-1' => 'A0']}, #TODO: also apply to iso-8859-9
	'iso-8859-4'   => {inherit => ['iso-8859-2' => 'A0']},
	'iso-8859-5'   => {inherit => ['iso-8859-1' => 'A0']},
	'iso-8859-6'   => {inherit => ['cp1256' => '80', 'iso-8859-1' => 'A0']},
	'iso-8859-7'   => {inherit => ['iso-8859-1' => 'A0']},
	'iso-8859-8'   => {inherit => ['iso-8859-1' => 'A0']},
	'iso-8859-9'   => {inherit => ['iso-8859-1' => 'D0-DF+F0']},
	'iso-8859-10'  => {inherit => ['iso-8859-4' => 'A0']},
	'iso-8859-11'  => {inherit => ['iso-8859-1' => 'A0']},
	'iso-8859-13'  => {inherit => ['iso-8859-4' => 'A0']},
	'iso-8859-14'  => {inherit => ['iso-8859-1' => 'A0']},
	'iso-8859-15'  => {inherit => ['iso-8859-1' => 'A0-BF']},
	'iso-8859-16'  => {inherit => ['iso-8859-2' => 'A0']},
	'hp-roman8'    => {inherit => ['iso-8859-1' => 'A0']},

	'cp1252'       => {inherit => ['iso-8859-1' => '80-9F']},
	'cp1250'       => {inherit => ['iso-8859-2' => '80-BF', 'cp1252' => '80']},
	'cp1254'       => {inherit => ['iso-8859-9' => '80-9F', 'cp1252' => '80-9F+D0']},
	'cp874'        => {inherit => ['iso-8859-11' => '80-9F', 'cp1252' => '80']}, # windows-874 actually cp1162
	'cp1257'       => {inherit => ['iso-8859-13' => '80-9F+FF', 'cp1252' => '80']},
	'cp1251'       => {inherit => ['cp1252' => '80']},
	'cp1253'       => {inherit => ['cp1252' => '80']},
	'cp1255'       => {inherit => ['iso-8859-8' => '80-DF', 'cp1252' => '80']},
	'cp1256'       => {inherit => ['cp1252' => '80']},
	'cp1258'       => {inherit => ['cp1252' => '80-9F+C0']},

	'cp850'        => {inherit => ['cp437' => '90']},
	'cp860'        => {inherit => ['cp437' => '80-AF']},
	'cp861'        => {inherit => ['cp865' => '80-AF']},
	'cp863'        => {inherit => ['cp437' => '80-AF']},
	'cp865'        => {inherit => ['cp437' => '90-AF']},
	'cp852'        => {inherit => ['cp850' => '80', 'cp437' => '80']},
	'cp857'        => {inherit => ['cp850' => '80-AF+D0-EF', 'cp437' => '80']},
	'cp775'        => {inherit => ['cp850' => '80']},  # partial cp437
	'cp866'        => {inherit => ['cp437' => '80-AF+E0']},
	'cp855'        => {inherit => ['cp437' => '80']},
	'cp1006'       => {inherit => ['iso-8859-6' => 'A0', 'cp437' => '80']},
	'cp737'        => {inherit => ['cp437' => '80-AF+E0']},
	'cp869'        => {inherit => ['cp437' => '80']},
	'cp862'        => {inherit => ['cp437' => '80-9F']},
	'cp864'        => {inherit => ['MacArabic' => '80', 'iso-8859-6' => '80', 'cp437' => '80']}, #TODO: compare form variants

	'koi8-u'       => {inherit => ['koi8-r' => '90-BF']},
	'koi8-f'       => {inherit => ['koi8-u' => '90-BF']},
	'mik'          => {inherit => ['cp437' => '80-D8', 'cp866' => 'B0'], setup => sub {
		$_[0]->{table} = [(map {chr} 0 .. 0x7F), qw(
			А Б В Г Д Е Ж З И Й К Л М Н О П
			Р С Т У Ф Х Ц Ч Ш Щ Ъ Ы Ь Э Ю Я
			а б в г д е ж з и й к л м н о п
			р с т у ф х ц ч ш щ ъ ы ь э ю я
			└ ┴ ┬ ├ ─ ┼ ╣ ║ ╚ ╔ ╩ ╦ ╠ ═ ╬ ┐
			░ ▒ ▓ │ ┤ № § ╗ ╝ ┘ ┌ █ ▄ ▌ ▐ ▀
			α ß Γ π Σ σ µ τ Φ Θ Ω δ ∞ φ ε ∩
			≡ ± ≥ ≤ ⌠ ⌡ ÷ ≈ ° ∙ · √ ⁿ ² ■
		), "\xA0"];
	}},

	'macromanian'  => {inherit => ['MacRoman' => 'A0-BF+D0-DF']},
	'macrumanian'  => {inherit => ['MacRomanian' => 'A0-BF+D0-DF', 'MacRoman' => 'A0-BF+D0-DF']},
	'maccroatian'  => {inherit => ['MacRoman' => 'A0']},
	'maccentraleurroman' => {inherit => ['MacRoman' => '80']},
	'macicelandic' => {inherit => ['MacRoman' => 'A0-AF+D0-EF']},
	'macturkish'   => {inherit => ['MacRoman' => 'D0-DF']}, # F5 is unassigned
	'macsami'      => {inherit => ['MacIcelandic' => '90-BF+D0-DF+F0', 'MacRoman' => '90']},
	'macgreek'     => {inherit => ['MacRoman' => '80']},
	'maccyrillic'  => {inherit => ['MacRoman' => '80']},
	'machebrew'    => {
		inherit => ['iso-8859-8' => '80', 'MacRoman' => '80-8F+A0'], # ignore partial ascii
		varchar => 1,
		replace => {
			# strip private use characters for unneeded roundtrip
			0xDE => chr(0x5C7), # qamats qatan
			0xC0 => 'לֹ', # lamed holam
			#TODO: private use for canoral codes (obsolete nikud positioning)
		},
	},
	'macarabic'    => {inherit => ['iso-8859-6' => '80', 'cp864' => '80', 'MacRoman' => '80']}, #TODO: multiple parents
	'macfarsi'     => {inherit => ['MacArabic' => 'B0-BF', 'MacRoman' => '80']},
	'macthai'      => {
		inherit => ['iso-8859-11' => '80-9F+D0'],
		varchar => 1,
		replace => {
			# strip appended private use characters for unneeded roundtrip
			0x83 => "\x{E48}", 0x88 => "\x{E48}", 0x98 => "\x{E48}",
			0x84 => "\x{E49}", 0x89 => "\x{E49}", 0x99 => "\x{E49}",
			0x85 => "\x{E4A}", 0x8A => "\x{E4A}", 0x9A => "\x{E4A}",
			0x86 => "\x{E4B}", 0x8B => "\x{E4B}", 0x9B => "\x{E4B}",
			0x87 => "\x{E4C}", 0x8C => "\x{E4C}", 0x9C => "\x{E4C}",
			0x8F => "\x{E4D}",
			0x92 => "\x{E31}", 0x93 => "\x{E47}", 0x94 => "\x{E34}",
			0x95 => "\x{E35}", 0x96 => "\x{E36}", 0x97 => "\x{E37}",
		},
	},

	'cp37'         => {inherit => ['posix-bc' => '00']},
	'posix-bc'     => {inherit => ['cp1047' => '40']},
	'cp500'        => {inherit => ['cp37' => '40-5F+B0-BF']},
	'cp1047'       => {inherit => ['cp37' => '10-2F+50-5F+A0-BF']},
	'cp1026'       => {inherit => ['cp37' => '40']},
	'cp875'        => {inherit => ['cp37' => '30']},

	legacy     => [qw( cp437 ATASCII PETSCII MSX ZX-Spectrum ANSEL )],
	'petscii'      => {inherit => ['' => '40-7F+A0-BF'], setup => sub {
		$_[0]->{table} = [(map {chr} 0 .. 0x3F), qw(
			@ a b c d e f g h i j k l m n o p q r s t u v w x y z [ £ ] ↑ ←
			🭹 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z ┼ 🮌 │ 🮖 🮘
			. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
			  ▌ ▄ ▔ ▁ ▏ ▒ ▕ 🮏 🮙 🮇 ├ ▗ └ ┐ ▂ ┌ ┴ ┬ ┤ ▎ ▍ 🮈 🮂 🮃 ▃ ✓ ▖ ▝ ┘ ▘ ▚
		)];
	}},
	'atascii'      => {inherit => ['' => '0-1F+60-7F'], setup => sub {
		$_[0]->{table} = [qw(
			♥ ├ 🮇 ┘ ┤ ┐ ╱ ╲ ◢ ▗ ◣ ▝ ▘ 🮂 ▂ ▖ ♣ ┌ ─ ┼ • ▄ ▎ ┬ ┴ ▌ └ ␛ ↑ ↓ ← →
			_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
			_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
			♦ a b c d e f g h i j k l m n o p q r s t u v w x y z ♠ | 🢰 ◀ ▶
		)];
	}},
	'zx-spectrum'  => {
		inherit => ['' => '50-8F'],
		set => 'ascii',
		replace => {
			ord('^') => '↑',
			ord('`') => '£',
			0x7F => '© ▝▘▀▗▐▚▜▖▞▌▛▄▟▙█',
		},
	},
	'msx'          => {inherit => ['cp437' => '80-FF'], setup => sub {
		$_[0]->{table} = [(map {chr} 0 .. 0x7F), qw(
			Ç ü é â ä à å ç ê ë è ï î ì Ä Å É æ Æ ô ö ò û ù ÿ Ö Ü ¢ £ ¥ ₧ ƒ
			á í ó ú ñ Ñ ª º ¿ ⌐ ¬ ½ ¼ ¡ « » Ã ã Ĩ ĩ Õ õ Ũ ũ Ĳ ĳ ¾ ∽ ◊ ‰ ¶ §
			▂ ▚ ▆ 🮂 ▬ 🮅 ▎ ▞ ▊ 🮇 🮊 🮙 🮘 🭭 🭯 🭬 🭮 🮚 🮛 ▘ ▗ ▝ ▖ 🮖 Δ ‡ ω █ ▄ ▌ ▐ ▀
			α ß Γ π Σ σ µ τ Φ Θ Ω δ ∞ ⌀ ∈ ∩ ≡ ± ≥ ≤ ⌠ ⌡ ÷ ≈ ° ∙ · √ ⁿ ² ■
		)];
	}},
	'brascii'      => {
		inherit => ['' => 'D0-DF+F0-FF'],
		setup => sub {
			$_[0]->{table} = [(map {chr} 0 .. 0xFF)];
		},
		replace => {
			0xD7 => 'Œ',
			0xF7 => 'œ',
		},
	},
	'ansel'        => {
		note => '+GEDCOM',
		inherit => ['' => 'A0-CF+E0-FE'],
		setup => sub {
			$_[0]->{table} = [
				(undef) x 0xA0,
				undef, qw( Ł Ø Đ Þ Æ Œ ʹ · ♭ ®    ±          Ơ Ư ʾ ), undef,
				qw( ʿ      ł ø đ þ æ œ ʺ ı £ ð ), undef, qw( ơ ư ), undef, undef,
				qw( °      ℓ ℗ © ♯ ¿ ¡ ), (undef) x 0x19,
				(map {$_ && chr}
					0x309, 0x300, 0x0301, 0x0302, 0x0303, 0x304, 0x306, 0x307,
					0x308, 0x30C, 0x030A, 0xFE20, 0xFE21, 0x315, 0x30B, 0x310,
					0x327, 0x328, 0x0323, 0x0324, 0x0325, 0x333, 0x332, 0x326,
					0x31C, 0x32E, 0xFE22, 0xFE23, undef,  undef, 0x313, undef,
				),
			];
		},
		replace => {
			# GEDCOM extensions
			0xBE => '□',
			0xBF => '■',
			0xCD => 'e', # endowment?
			0xCE => 'o', # ordinance?
			0xCF => 'ß',
			0xFC => "\x{338}",
			# MARC21 extensions
			0xC7 => 'ß',
			0xC8 => '€',
		},
	},
	'ti86'         => {
		note => 'similar to TI85',
		inherit => ['', => '0-1F+80-EC'],
		setup => sub {
			$_[0]->{table} = [
				undef, qw(
					𝐛 𝐨 𝐝 𝐡 ▶ ⬆ ⬇ ∫ × 𝐀 𝐁 𝐂 𝐃 𝐄 𝐅
					√ ⁻¹ ² ∠ ° ʳ ᵀ ≤ ≠ ≥ ⁻ ᴇ → ⏨ ↑ ↓
				),
				(undef) x 0x60,
				qw(
					₀ ₁ ₂ ₃ ₄ ₅ ₆ ₇ ₈ ₉ Á À Â Ä á à
					â ä É È Ê Ë é è ê ë Í Ì Î Ï í ì
					î ï Ó Ò Ô Ö ó ò ô ö Ú Ù Û Ü ú ù
					û ü Ç ç Ñ ñ ´ ` ¨ ¿ ¡ α β γ Δ δ
					ϵ θ λ μ π ρ Σ σ τ ϕ Ω x̅ y̅ ˟ … ◀
					■ ∕ ‐ ² ° ³ :⃞ ➧ ⧵ 🙽 ◥ ◣ ⊸ ∘ ⋱ █
					⇧ A⃞ a⃞ _ ⇧̲ A̲ a̲ ▒ ⬞ ˖ · ⁴ ﹦
				),
			];
		},
	},
	'ti89'         => {
		note => 'also TI92(+)',
		inherit => ['', => '0-1F+7F-BE'],
		setup => sub {
			$_[0]->{table} = [
				qw(
					▒ ␁ ␂ ␃ ␄ ␅ ␆ 🔔 ⌫ ⇥ ), chr(0xA), qw( ⬏ ⤒ ↵ 🔒 ✓
					■ ◂ ▸ ▴ ▾ ← → ↑ ↓ ◀ ▶ ⬆ ∪ ∩ ⊂ ∈
				),
				(map {chr} 0x20 .. 0x7E), '◆',
				qw(
					α β Γ γ Δ δ ε ζ θ λ ξ ∏ π ρ ∑ σ
					τ ϕ ψ Ω ω ᴇ ℯ 𝐢 ʳ ᵀ x̅ y̅ ≤ ≠ ≥ ∠
					… ¡ ¢ £ ¤ ¥ ¦ § √ © ª « ¬ ⁻ ® ¯
					° ± ² ³ ⁻¹ µ ¶ · ⁺ ¹ º » 𝑑 ∫ ∞ ¿
				),
			];
		},
	},

	''             => {setup => sub {
		my $row = shift;
		$row->{offset} = delete $row->{startpoint};
		$row->{set} = 'Unicode characters';
		my $block = $row->{offset} >> 8;
		$row->{endpoint} ||= ($block + 1 << 8) - 1;
		$block == ($row->{endpoint} >> 8) or undef $block;

		$row->{table} = join '', map { chr =~ s/\A\p{Unassigned}\z/�/r }
			$row->{offset} .. $row->{endpoint};
		utf8::upgrade($row->{table});  # prevent latin1 output

		$row->{endpoint} -= $row->{offset};

		if (defined $block) {
			$row->{set} = sprintf 'Unicode block U+%02Xxx', $block;
			$row->{offset} %= 0x100;
		}

		return $row;
	}},
	u              => {setup => sub {
		my $row = shift;
		state $celldata = do 'charset-unicode.inc.pl'
			or Alert('Table data could not be read', $@ || $!);
		$row->{cell} = $celldata;

		$row->{endpoint} ||= 0x1FFF;
		$row->{set} = 'Unicode ' . (
			$row->{startpoint} <  0x1000 && $row->{endpoint} < 0x1000 ? 'BMP' :
			$row->{startpoint} >= 0x1000 && $row->{endpoint} < 0x2000 ? 'SMP' :
			'allocations'
		);
		return $row;
	}},
	uu             => {setup => sub {
		my $row = shift;
		$row->{cell} = do 'charset-ucplanes.inc.pl'
			or Alert('Table data could not be read', $@ || $!);
		$row->{endpoint} ||= 0x3FF;
		$row->{set} = 'Unicode planes';
		return $row;
	}},
	utf8           => {setup => sub {
		my $row = shift;
		$row->{set} = 'UTF-8';
		$row->{cell} = do 'charset-utf8.inc.pl'
			or Alert('Table data could not be read', $@ || $!);
		return $row;
	}},
	'utf-8'        => 'utf8',
};
