FireBirdLib - Topfield TMS PVR TAP Programming Library
LowerCase.c
Go to the documentation of this file.
1
#include <ctype.h>
2
#include <string.h>
3
#include "
FBLib_string.h
"
4
5
void
LowerCase
(
char
*
string
)
6
{
7
TRACEENTER
();
8
9
char
*p, *s;
10
byte
UTF8[5];
11
byte
BytesPerCharacter;
12
13
p = string;
14
while
(*p)
15
{
16
isUTF8Char
(p, &BytesPerCharacter);
17
if
(BytesPerCharacter > 1)
18
{
19
memcpy(UTF8, p, BytesPerCharacter);
20
UTF8[BytesPerCharacter] =
'\0'
;
21
s = strstr(
UTF8Upper
, UTF8);
22
if
(s) memcpy(p, &
UTF8Lower
[(dword)s - (dword)
UTF8Upper
], BytesPerCharacter);
23
}
24
else
25
{
26
s = strchr(
AnsiUpper
, *p);
27
if
(s)
28
{
29
*p =
AnsiLower
[(dword)s - (dword)
AnsiUpper
];
30
}
31
else
32
{
33
*p = tolower(*p);
34
}
35
}
36
37
p += BytesPerCharacter;
38
39
}
40
41
TRACEEXIT
();
42
}
FBLib_string.h
AnsiUpper
char AnsiUpper[30]
Definition:
StrToUTF8.c:132
UTF8Lower
char UTF8Lower[64]
Definition:
StrToUTF8.c:136
AnsiLower
char AnsiLower[30]
Definition:
StrToUTF8.c:133
UTF8Upper
char UTF8Upper[64]
Definition:
StrToUTF8.c:135
LowerCase
void LowerCase(char *string)
Definition:
LowerCase.c:5
TRACEEXIT
#define TRACEEXIT()
Definition:
libFireBird.h:1244
TRACEENTER
#define TRACEENTER()
Definition:
libFireBird.h:1243
isUTF8Char
bool isUTF8Char(const byte *p, byte *BytesPerChar)
Definition:
isUTF8Char.c:3
string
LowerCase.c
Generated on Fri Apr 29 2022 13:34:01 for FireBirdLib - Topfield TMS PVR TAP Programming Library by
1.9.3