mirror of
https://github.com/sharkdp/hexyl.git
synced 2026-10-26 20:16:34 +00:00
Add codepage 1047 for EBCDIC
This commit is contained in:
3 files changed
+93
No files matched your search
@@ -46,3 +46,37 @@ pub const CP437: [char; 256] = [
|
||||
'α','ß','Γ','π','Σ','σ','µ','τ','Φ','Θ','Ω','δ','∞','φ','ε','∩',
|
||||
'≡','±','≥','≤','⌠','⌡','÷','≈','°','∙','·','√','ⁿ','²','■','ff',
|
||||
];
|
||||
|
||||
#[rustfmt::skip]
|
||||
pub const CP1047: [char; 256] = [
|
||||
//
|
||||
// Copyright (c) 2016,2024 IBM Corporation and other Contributors.
|
||||
//
|
||||
// All rights reserved. This program and the accompanying materials
|
||||
// are made available under the terms of the Eclipse Public License v1.0
|
||||
// which accompanies this distribution, and is available at
|
||||
// http://www.eclipse.org/legal/epl-v10.html
|
||||
//
|
||||
// Contributors:
|
||||
// Mark Taylor - Initial Contribution
|
||||
//
|
||||
|
||||
// ref1 https://github.com/ibm-messaging/mq-smf-csv/blob/master/src/smfConv.c
|
||||
// ref2 https://web.archive.org/web/20150607033635/http://www-01.ibm.com/software/globalization/cp/cp01047.html
|
||||
'.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.',
|
||||
'.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.',
|
||||
'.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.',
|
||||
'.','.','.','.','.','.','.','.','.','.','.','.','.','.','.','.',
|
||||
' ','.','.','.','.','.','.','.','.','.','$','.','<','(','+','|',
|
||||
'&','.','.','.','.','.','.','.','.','.','!','$','*',')',';','.',
|
||||
'-','/','.','.','.','.','.','.','.','.','.',',','%','_','>','?',
|
||||
'.','.','.','.','.','.','.','.','.','.',':','#','@','\'','=','.',
|
||||
'.','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','.','.','.','.','.','.',
|
||||
'0','1','2','3','4','5','6','7','8','9','.','.','.','.','.','.'
|
||||
];
|
||||
@@ -36,6 +36,10 @@ pub enum CharacterTable {
|
||||
/// Show printable ASCII as-is, ' ' for space, '.' for everything else.
|
||||
Ascii,
|
||||
|
||||
/// Show printable EBCDIC as-is, ' ' for space, '.' for everything else.
|
||||
#[value(name = "codepage-1047")]
|
||||
CP1047,
|
||||
|
||||
/// Uses code page 437 (for non-ASCII bytes).
|
||||
#[value(name = "codepage-437")]
|
||||
CP437,
|
||||
@@ -107,6 +111,7 @@ impl Byte {
|
||||
AsciiOther => '.',
|
||||
NonAscii => '.',
|
||||
},
|
||||
CharacterTable::CP1047 => CP1047[self.0 as usize],
|
||||
CharacterTable::CP437 => CP437[self.0 as usize],
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user