Giter Site home page Giter Site logo

lc6464 / base16384.net Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 111 KB

Base16384 编解码器的 .NET 跨平台控制台应用程序。

License: GNU General Public License v3.0

C# 100.00%
base16384 big-endian binary character chinese-character cross-platform dotnet dotnet-console utf16be

base16384.net's Introduction

Base16384.Net

参考:fumiama/base16384 实现:lc6464/LC6464.Base16384

此项目引用实现后的库,作为控制台应用程序供用户使用。

使用方法

Base16384.Net <"e" | "d"> <source | "-"> [out | "-"]
  • 参数一:e 为编码;d 为解码。
  • 参数二:源文件(夹)路径,可以传入逗号分隔的文件列表,输入 - 则表示从标准输入读取数据。
  • 参数三:输出文件(夹)路径,可选,其中输出到标准输出时无信息提示。
    • 缺省
      • 输入为标准输入时,结果输出到标准输出
      • 输入为文件时,结果写入 源文件名.encoded源文件名.decoded
      • 输入为文件夹或逗号分隔的文件列表时,结果写入到 encodeddecoded 文件夹内相应结构的文件内
    • - 表示输出到标准输出,输入为文件夹或逗号分隔的文件列表时无效
    • 其他
      • 输入为文件时,输出到指定文件
      • 输入为文件夹或逗号分隔的文件列表时,输出到指定文件夹
  • 示例
    • 编码
      • Base16384.Net.exe e C:\Users\lc6464\Desktop\test.mp4 C:\Users\lc6464\Desktop\test.mp4.txt
      • $PSVersionTable.OS | Base16384.Net e - /root/os.txt
      • Base16384.Net e "/home/lc6464/hello world.jpg" - > /dev/null
    • 解码
      • Base16384.Net.exe d C:\Users\lc6464\Desktop\test.encoded C:\Users\lc6464\Desktop\test.py
      • Base16384.Net d /root/os.txt -
      • Base16384.Net d /root/filesEncoded /home/lc6464/rawFiles
    • 测试
      • Base16384.Net.exe e C:\Users\lc6464\Desktop\test.mp4 - | Base16384.Net.exe d - C:\Users\lc6464\Desktop\test.mp4
      • $PSVersionTable.OS | Base16384.Net e - | Base16384.Net d -

出错时调试

将环境变量 Base16384_Net_Debug 设为 true1 等值,可输出调试信息。
特别注意,即使编解码到标准输出,也会输出异常信息!
只要环境变量 Base16384_Net_Debug 存在且不为空,且转小写后不为 false0,就会进入调试模式。
特别注意,只有值为 false0 会被认为是关闭调试模式,其他值都会被认为是开启调试模式
若环境变量 Base16384_Net_Debug 不存在为空,则不进入调试模式。

注意事项

UTF16BE 编码的文件需要 BOM,使用输出到文件时,会自动添加 BOM,
但输出到标准输出时,不会添加 BOM,因此强烈不建议在终端通过标准输出输出后直接重定向到文件!
如果需要输出到标准输出时通过其他软件或表达式处理后输出到文件,务必手动添加 BOM,否则可能导致兼容性问题!

另外,通过标准输出输出的结果是 UTF16BE 编码后的二进制数据,终端直接显示可能会乱码。

下载软件

  • 可直接通过 GitHub Release 下载。
  • 克隆项目通过 Visual Studio 或 dotnet cli 自行编译。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.