unicode.c

来自「嵌入式系统中文件系统源代码」· C语言 代码 · 共 41 行

C
41
字号
/*************************************************************
File Name: UNICODE.C                                         *
**************************************************************
Programmer: MSC
Last Modified Date: 1999/08/22
Compiler : Gnu Cross-compiler
Platform : X86 protection mode
Usage :
	Unicode-related routines
*************************************************************/

#include "../include/unicode.h"


/*************************************************************
Function: getUnicodeLen
Description:
	get the unicode length of a string
Input:
	src - the source string with a mix of single-byte and
	      double-byte chars
Output:
**************************************************************/
int getUnicodeLen(unsigned char *src)
{
  int length = 0;

  while (*src != '\0')
  {
	length++;
	if (*src > 0x80)
		src += 2;
	else
		src++;
  }
  return length;
}



⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?