Skip to main content

Ein Unicode-Codepunkt-Dump.

Denke es dir als hexdump(1) für Unicode. Der Befehl analysiert die Eingabe und gibt dann drei Spalten aus: die direkte Byte-Position des ersten Codepunkts in dieser Zeile, Codepunkte in ihrer Hex-Schreibweise und schließlich die rohen Eingabezeichen, wobei Kontrollzeichen und Leerzeichen durch einen Punkt ersetzt wurden.

Ungültige Byte-Sequenzen werden mit einem „X“ dargestellt und mit dem Hex-Wert in Fragezeichen eingeschlossen, z. B., „?F5?“.

Du kannst Daten von stdin einleiten, mehrere Dateien auf einmal auswählen oder sogar alle diese Eingabemethoden durcheinander verwenden.

Beispiele:

  • Basic usage with stdin:

    echo -n 'ABCDEFGHIJKLMNOP' | unidump -n 4
          0    0041 0042 0043 0044    ABCD
          4    0045 0046 0047 0048    EFGH
          8    0049 004A 004B 004C    IJKL
         12    004D 004E 004F 0050    MNOP
  • Dump the code points translated from another encoding:

    unidump -c latin-1 some-legacy-file
  • Dump many files at the same time:

    unidump foo-*.txt
  • Control characters and whitespace are safely rendered:

    echo -n -e '\x01' | unidump -n 1
         0    0001    .
  • Finally learn what your favorite Emoji is composed of:

    ( echo -n -e '\xf0\x9f\xa7\x9d\xf0\x9f\x8f\xbd\xe2' ; \
      echo -n -e '\x80\x8d\xe2\x99\x82\xef\xb8\x8f' ; ) | \
    unidump -n 5
         0    1F9DD 1F3FD 200D 2642 FE0F    .🏽.♂️

See <https://emojipedia.org/man-elf-medium-skin-tone/> for images. The “elf” emoji (the first character) is replaced with a dot here, because the current version of Python’s unicodedata doesn’t know of this character yet.

  • Use it like strings(1):

    unidump -e '{data}' some-file.bin

Das ersetzt jedes unbekannte Byte aus der Eingabedatei mit „X“ und jedes Kontroll- und Leerzeichen mit „.“.

  • Only print the code points of the input:

    unidump -e '{repr}'$'\n' -n 1 some-file.txt

Das Ergebnis ist eine Folge von Codepunkten in Hex-Notation, jeder auf einer eigenen Zeile, ohne Byte-Zähler oder Darstellung der tatsächlichen Daten. Du kannst das verwenden, um die Gesamtzahl an Zeichen (nicht rohe Bytes) in einer Datei zu bestimmen, indem du es durch wc -l pipest.

Das ist version 1.1.4 von unidump mit Unicode-13.0.0-Daten.

Release files for unidump 1.1.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for unidump 1.1.4
File Size Uploaded
unidump-1.1.4.tar.gz 10.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for unidump 1.1.4
File Interpreter ABI Platform
unidump-1.1.4-py3-none-any.whl Python 3 none any Details

Total release size: 22.1 kB

Release files / unidump-1.1.4.tar.gz

Download URL unidump-1.1.4.tar.gz
Size 10.3 kB
Tags Source
SHA-256 checksum
How to use checksums
be39ba0beff5b50cab11f5ce5de9c03c3a4f5437755f2d93e9a176f5c30586b3
BLAKE2b-256 checksum
How to use checksums
58c1e5ad58903d895c62206f7a625ee3c1ccd4fe6f70a5b0dd87ed6557e3093b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.12

Release files / unidump-1.1.4-py3-none-any.whl

Download URL unidump-1.1.4-py3-none-any.whl
Size 11.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
24293269f06cd627255034e0d755526b6d43443eeb104c3c773e50e6b9d8c2cb
BLAKE2b-256 checksum
How to use checksums
c6a37fdce5d74be37ba232ac0371a77aadc0ebe9e0602914560d38c9fd7b842b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.12

Release history Release notifications | RSS feed

This release

1.1.4 This release

2 release files

1.1.2

2 release files

1.1.1

2 release files

1.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page