Crate ctb_formats_dceutils

Crate ctb_formats_dceutils 

Source
Expand description

LLM-assisted port of dceutils. Note that most of this is a direct port of the PHP implementation and it attempts to preserve its bugs and incompleteness as-is. The converter.rs module is a newly created alternative that attempts to be more complete and correct. The DCE 3.02a format isn’t technically implementable because it doesn’t define a version selector for that version; as implemented here it uses the byte assignment where a version selector ought to have gone.

Format support and notes:

FormatFormat codeReadWrite — Notes
CDCE-based formats:
CDCEcdce
CDCE (legacy)1legacy_cdceXX
CDCE (legacy, strict)2cdce_lstrictXN/A
Generic DCE formats (automatic version selection):
DCE3dceXX
DCE (hex-encoded)hex_dceXX
DCE 3.0a-based formats:
DCE 3.0a43_0aXX
DCE 3.0a (raw)dce_3_0a_rawXX
DCE 3.0a (hex-encoded)4hex_3_0aXX
DCE 3.0a (raw hex-encoded)hex_3_0a_rawXX
DCE 3.0a (old translator)53_0a_old(X)N/A (No tests)
dce2txt6dce2txt(X)N/A (No tests)
dce2hex6dce2hex(X)N/A (No tests)
hex2dce6hex2dce(X)N/A (No tests)
DCE 3.01a-based formats:
DCE 3.01a4,73_01a(X)(X)
DCE 3.01a (raw)dce_3_01a_raw(X)
DCE 3.01a (hex-encoded)4,7hex_3_01a(X)(X)
DCE 3.01a (raw hex-encoded)hex_3_01a_raw(X)
Miscellaneous DCE formats:
Dc ID list (ASCII)1dcXX
Unicode:
UTF-81utf8XX
UTF-321utf32XX
UTF-8 (Base64-encoded)utf8_base64XX
UTF-8 (Base64-encoded, ASCII Dc ID list)utf8_dc64XX
UTF-8 (Base64-encoded, ASCII Dc ID list; with headers)utf8_dc64_encXX
UTF-8 (Base64-encoded, DCE 3.01a+ encoding)utf8_dc64_binXX
UTF-8 (Base64-encoded, DCE 3.01a+ encoding; hex-encoded)utf8_dc64_bin_hexXX
UTF-8 (Base64-encoded, DCE 3.01a+ encoding; with headers)utf8_dc64_bin_encXX
UTF-8 (Base64-encoded, DCE 3.01a+ encoding; with headers; hex-encoded)utf8_dc64_bin_enc_hexXX
HTML:
HTMLhtml
HTML (snippet)html_snippet
HTML (legacy CDCE output)7html_l(X)
HTML (snippet) (legacy CDCE output)7html_snippet_l(X)

  1. Reading/writing these formats may not be lossless with DCE 3.0a. ↩ 1 2 3 4

  2. Note that cdce_lstrict is not actually a separate format from legacy_cdce; rather, it is an alias of legacy_cdce that instructs the parser to halt upon reaching an incorrectly structured CDCE sequence (by default it will attempt to recover from the error). ↩

  3. Automatically detects DCE version when reading, and writes to the latest DCE version that is well supported. ↩

  4. Since this is a DCE format, simply enter DCE as the format when reading. Note that writing to old versions of DCE may not be lossless. ↩ 1 2 3 4

  5. This is an early version of the DCE 3.0a translator, not a separate format. Leave the output format blank when using this translator, since the same code handles both input and output. This is not tested or maintained, and may or may not work properly. ↩

  6. These are miscellaneous outdated translators, not separate formats. Leave the output format blank when using them, since the same code handles both input and output. These are not tested or maintained, and may or may not work properly. ↩ 1 2 3

  7. It’ll try but it probably won’t work or won’t work well. Note that the HTML translators only work with legacy CDCE input and are very buggy (alpha quality). ↩ 1 2 3 4

Re-exports§

pub use converter::DceVersion;
pub use converter::MAX_DCE_3_0A_SHORT_DC;
pub use converter::MAX_DCE_3_01A_SHORT_DC;
pub use converter::MAX_DCE_3_02A_SHORT_DC;
pub use converter::decode_dce_preserving_controls;
pub use converter::encode_dce_preserving_controls;
pub use converter::is_dce_encoding_control_dc;
pub use converter::dce_convert as dce_convert_new;
pub use converter::dce_convert_with_log as dce_convert_new_with_log;
pub use converter::dce_convert_with_options as dce_convert_new_with_options;

Modules§

cdce
CDCE character set decoder and data conversion utilities.
cli
CLI execution helpers for DCE utilities.
converter
Specification-oriented DCE 3.0a / 3.01a / 3.02a and CDCE converters.
dce3_0a
DCE 3.0a specification character set and codepage conversion.
dce3_01a
DCE 3.01a specification character set and codepage conversion.
document
Conversion between dceutils formats (CdceLegacy, Dce, Dce_3_0a, Dce_3_01a, etc.) and DcMstring.
legacy
Legacy character encodings and fallback translation tables.
tables
Character translation tables and lookup indices for DCE formats.
to_csv
Utilities for processing and parsing DCE data files.
tools
Transformation and inspection helper tools for DCE data.
unicode
DCE document format to Unicode mapping and normalized sequence conversions.

Structs§

FormatLog

Functions§

convert_dc_to_dc_output
dce_convert
dce_convert_with_log
get_dce_version
get_dce_version_with_log