life's a struggle.
Intelligence without ambition is a bird without wings.
2014-12-11
2014-12-10
概念
python使用unicode作为字符串内部编码,所有转换应通过unicode进行
编码(encode),将中间对象(unicode object)转为其他编码对象
解码(decode),将其他编码对象转为中间对象(unicode object)
非unicode object转unicode object
前提必须清楚字符串是什么编码,假设str为gbk编码
u = str.decode('gbk')
或
u = unicode(str, 'gbk')
unicode object转非unicode object
假设转为utf-8
utf8 = u.encode('utf-8')
2014-12-10
构造方法
str
‘string’
该字符串常量编码取决于源文件编码
unicode object
u’string’
构造的对象为unicode object,若需转换为其他编码,无需decode操作
2014-12-10
阅读此文
2014-12-10
环境
- VS2010
- openssl-1.0.1j
- curl-7.39.0
编译
下载官网,解压
将编译好的
openssl({ iLink title:win下编译openssl %})拷贝到../deps
进入
winbuild目录编译(具体参考
winbuild/BUILD.WINDOWS.txt)release
nmake /f Makefile.vc mode=dll VC=10 WITH_SSL=dll ENABLE_IDN=no
debug
nmake /f Makefile.vc mode=dll VC=10 WITH_SSL=dll ENABLE_IDN=no DEBUG=yes
输出目录为
builds
2014-12-10
前提
- perl
- VC++
编译(详细过程参考INSTALL.W32)
生成
Makefileperl Configure VC-WIN32 no-asm --prefix=c:/some/openssl/dir ms\do_ms编译
nmake -f ms\ntdll.mak测试
nmake -f ms\ntdll.mak test安装
nmake -f ms\ntdll.mak install
2014-12-09
2014-12-09
阅读此文
2014-12-09
阅读此文
2014-12-09
前提
- VC++(改用其他编译器,下面的Makefile需要改成对应的)
- cmake
编译
下载官网
解压,在根目录新建
build目录[可选]
debug库添加d后缀编辑根目录下
CMakelists.txt,添加一行SET(CMAKE_DEBUG_POSTFIX d)cd build生成
makefileshared-debug
cmake -DCMAKE_BUILD_TYPE=debug -DJSONCPP_LIB_BUILD_SHARED=ON -DCMAKE_INSTALL_PREFIX=./jsoncpp-0.7.0-shared-debug -G "NMake Makefiles" ..shared-release
cmake -DCMAKE_BUILD_TYPE=release -DJSONCPP_LIB_BUILD_SHARED=ON -DCMAKE_INSTALL_PREFIX=./jsoncpp-0.7.0-shared-release -G "NMake Makefiles" ..static-debug
cmake -DCMAKE_BUILD_TYPE=debug -DJSONCPP_LIB_BUILD_SHARED=OFF -DCMAKE_INSTALL_PREFIX=./jsoncpp-0.7.0-static-debug -G "NMake Makefiles" ..static-release
cmake -DCMAKE_BUILD_TYPE=release -DJSONCPP_LIB_BUILD_SHARED=OFF -DCMAKE_INSTALL_PREFIX=./jsoncpp-0.7.0-static-release -G "NMake Makefiles" ..
编译
nmake安装
nmake install生成
doxygen文档python doxybuild.py --doxygen="d:\Program Files\doxygen\bin\doxygen.EXE" --open
问题
- 为什么使用
nmake(/MT)和vs2010(/MD)编译链接的C运行库版本不一致?

