We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
源码中有如下一段:
private byte[] _bytes(string s) { return Encoding.Default.GetBytes(s); } private string _string(byte[] bs) { return Encoding.Default.GetString(bs); }
经过测试, 在我的Windows 7系统上, Encoding.Default的值是DBCSCodePageEncoding, 在Ubuntu系统上, Encoding.Default的值是UTF8Encoding.
Encoding.Default
DBCSCodePageEncoding
UTF8Encoding
首先windows上,那个非常不常见的encoding会导致数据丧失可移植性. 把数据拷贝到其它的系统上多半就不能读取了.
再次在不同的系统之间, Encoding.Default的值不同, 这会导致基于这个API编写的代码丧失跨平台性.
我个人感觉不妨直接把encoding定死为UTF8Encoding. 这个编码绝大部分情况下是没有问题的. 另外可以给构造函数加个参数, 允许指定编码.
我自己基于这个api改了很多, 有时间我可能会另外创建一个repo公开我的代码. 目前就先提以上意见, 供参考.
感谢开发维护SSDB!
The text was updated successfully, but these errors were encountered:
好的, 多谢反馈! 欢迎把你的代码合并进来. 或者我考虑给 SSDB 类提供一个 setEncoding() 方法, 替代 Encoding.Default
Sorry, something went wrong.
No branches or pull requests
源码中有如下一段:
经过测试, 在我的Windows 7系统上,
Encoding.Default
的值是DBCSCodePageEncoding
, 在Ubuntu系统上,Encoding.Default
的值是UTF8Encoding
.首先windows上,那个非常不常见的encoding会导致数据丧失可移植性. 把数据拷贝到其它的系统上多半就不能读取了.
再次在不同的系统之间,
Encoding.Default
的值不同, 这会导致基于这个API编写的代码丧失跨平台性.我个人感觉不妨直接把encoding定死为UTF8Encoding. 这个编码绝大部分情况下是没有问题的. 另外可以给构造函数加个参数, 允许指定编码.
我自己基于这个api改了很多, 有时间我可能会另外创建一个repo公开我的代码. 目前就先提以上意见, 供参考.
感谢开发维护SSDB!
The text was updated successfully, but these errors were encountered: