HexConverter
· 1 min
goclifyneencoding
Turns text into hexadecimal and back, in the character set you choose: UTF-8, UTF-16, ISO-8859-1, ISO-8859-9, windows-1254 or US-ASCII. The earlier version was a JavaFX window. This one is written in Go: the same window, plus a command line tool, both as single binaries without a Java runtime.
What is inside?
- A desktop window built with Fyne: type text or hex, pick the character set, press Text To Hex or Hex To Text, and copy the result.
- A command line tool,
hexconv, in pure Go. It builds anywhere without a C compiler. - Forgiving hex input:
48 65 6c 6c 6f,48:65:6C:6C:6Fand0x48,0x65all work, in upper or lower case. Odd digit counts and non-hex characters are rejected with a message. - Honest errors: a character the chosen character set cannot hold (
ğin US-ASCII) is reported. The Java version wrote?instead, so converting back gave a different text. - The converter is a Go package,
hexconv, that other programs can import.
go install github.com/ergulcu/HexConverter/cmd/hexconv@latest
hexconv to-hex "Merhaba" # 4d657268616261
echo "4d 65 72 68 61 62 61" | hexconv to-text # Merhaba
hexconv -charset ISO-8859-9 to-hex ğ # f0
Source code: github.com/ergulcu/HexConverter