linux控制台显示中文
#include <stdio.h>
#include <wchar.h>
#include <locale.h>
int main()
{
#ifdef _WIN32
setlocale(LC_ALL, "chs");
#else
setlocale(LC_ALL, "zh_CN.UTF-8");
#endif
wchar_t KZg[] = {0x6211, 0};
char buf[10] = {0};
wcstombs(buf,KZg,10);
printf("_%s_\n",buf);
}
wchar_t 在linux上是4个字节, 在win32上是2个字节, MinGW也是2个字节.
一般会节省空间使用utf-16.
#ifdef _WIN32
typedef wchar_t uchar;
#else
typedef unsigned short uchar; // 就不能使用string.h提供的宽字符串方法了.
#endif
linux上使用string常量只能用{}.
相关文档:
/*
kmalloc can apply 128KB memory only. This func support any continous memory allocate more than 2MB.
*/
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/module.h>
#include <linux/kallsyms.h>
#define KMEM_PAGES &nb ......
<!--
@page { margin: 2cm }
P { margin-bottom: 0.21cm }
A:link { so-language: zxx }
-->
一个
Linux
发行版,体积很小,用处反而很大。此话当真?
一般而言,老式计算机内存都不大, ......
连接上了服务器,检查一下。磁盘空间不够了
[java@localhost ~]$ df -lh
Filesystem Size Used Avail Use% Mounted on
/dev/hda2 5.8G 5.8G 0M 100% /
/dev/hda1 99M 8.5M 86M 10% /boot
none 506M 0 506M 0% /dev/shm
/dev/hda6 20G 77M 19G 1% /tmp
/dev/hda5 20G 14G 5.2G 72% /usr/local
/dev/hd ......
--这里所有的perl技术问题都是我平常处理数据的时候要用到的,可能不是很强的程序,但是希望能和热爱perl的同志,一起分享...
在很多情况下,我们需要从远处服务器上下载当天或者昨天生成的日志文件,来查看一些我们需要的东西或者备份。
如果采用了ftp,那么我们 ......