encode
for strings> encode {flags} (encoding)
--ignore-errors, -i
: when a character isn't in the given encoding, replace with a HTML entity (like 🎈
)encoding
: the text encoding to useinput | output |
---|---|
string | binary |
Encode an UTF-8 string into Shift-JIS
>"負けると知って戦うのが、遥かに美しいのだ"|encodeshift-jis
Length:40 (0x28) bytes|printablewhitespaceascii_othernon_ascii
00000000:958982af82e982c6926d82c182c490ed×××××××××m××××××
00000010:82a482cc82aa8141977982a982c994fc×××××××A×y××××××
00000020:82b582a282cc82be××××××××
Replace characters with HTML entities if they can't be encoded
>"🎈"|encode-ishift-jis
Length:9 (0x9) bytes|printablewhitespaceascii_othernon_ascii
00000000:26233132373838303b🎈
Multiple encodings are supported; here are a few: big5, euc-jp, euc-kr, gbk, iso-8859-1, cp1252, latin5
Note that since the Encoding Standard doesn't specify encoders for utf-16le and utf-16be, these are not yet supported.
For a more complete list of encodings, please refer to the encoding_rs documentation link at https://docs.rs/encoding_rs/latest/encoding_rs/#statics
name | type | usage |
---|---|---|
encode base64 |
Builtin | Encode a string or binary value using Base64. |
encode hex |
Builtin | Encode a binary value using hex. |
Copyright © 2019–2023 The Nushell Project DevelopersLicensed under the MIT License.
https://www.nushell.sh/commands/docs/encode.html