Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <string.h>
- int main() {
- unsigned char a[] = "Ąąa";
- //Kaip atrodo šešioliktainėje Ą=c4 84 ą=c4 85 a=61
- //UTF-8 simbolių lentelė su šešioliktainiais kodais: http://www.utf8-zeichentabelle.de/unicode-utf8-table.pl?number=1024&htmlent=1
- unsigned int i=0, length=strlen(a);
- char found=0;
- //printf("%x", 'a');//Išvedimas šešioliktainiu kodu
- while(i<length) {
- if(found) {
- if(a[i] == 0x84) puts("Lietuviška A didžioji raidė");
- else if(a[i] == 0x85) puts("Lietuviška a mažoji raidė");
- found=0;
- } else {
- if(a[i] == 0xC4) found = 1;
- else if(a[i] == 0x61) puts("paprasta a mažoji raidė");
- }
- i++;
- }
- return 0;
- }
- ================
- Programa išveda:
- ================
- Lietuviška A didžioji raidė
- Lietuviška a mažoji raidė
- paprasta a mažoji raidė
Advertisement
Add Comment
Please, Sign In to add comment