亚洲av成人无遮挡网站在线观看,少妇性bbb搡bbb爽爽爽,亚洲av日韩精品久久久久久,兔费看少妇性l交大片免费,无码少妇一区二区三区

  免費注冊 查看新帖 |

Chinaunix

  平臺 論壇 博客 文庫
最近訪問板塊 發(fā)新帖
查看: 5184 | 回復(fù): 5
打印 上一主題 下一主題

[C] 關(guān)于讀取Unicode字符并且進行大小寫轉(zhuǎn)換的問題 [復(fù)制鏈接]

論壇徽章:
0
跳轉(zhuǎn)到指定樓層
1 [收藏(0)] [報告]
發(fā)表于 2009-10-15 09:26 |只看該作者 |倒序瀏覽
#include "windows.h"
#include "stdafx.h"
#include "conio.h"
#include "stdio.h"
#include "stdlib.h"
#include "string.h"
#include "ctype.h"


int _tmain(int argc, _TCHAR* argv[])
{
    FILE *fp;
    FILE *fp2;
    char ch[100];
    char filename[100];
    char filename2[100];
    char filename3[100];
    TCHAR address[100];
    int count = 0;
    int i,l,tmp;

        if(argc!=2)
        {
               
                printf("For Example.   transfer.exe  C:\test.txt \n",argv[0]);
    }
    else{
                wcscpy(address,argv[1]);
              //  strcpy(filename3,(char *)argv[2]);
                }

        fp=_tfopen(address, _T("r"));
        if(fp == NULL)
    {
        printf("Cannot open file. Press any key exit!");
        getch();     
        exit(1);
    }

       
    tmp = fscanf(fp,"%s",ch);
   
        if(tmp == NULL)
        {
         printf("The config file is empty!");
         exit(1);
        }
        strupr(ch);
        strcpy(filename, ch);
   

    fp2 = fopen(filename, "w");
    if(fp2 != NULL)
    {
        printf("file[%s] has been created!\n", filename);
        fclose(fp2);
        l = strlen(filename);
        for(i=0;i<=l;i++) filename2 = filename;
        for(i=0;i<=l;i++)
        {
            fp2 = fopen(filename2, "r");
            if(fp2 != NULL)
                        {
                                printf("file[%s] can be opened!\n", filename2);
                                fclose(fp2);
                        }
            else
                                printf("Cannot open file[%s]!\n", filename2);
            

            filename2 = tolower(filename2) ;
            filename2[l] = '\0';
        }
    }
    else printf("Cannot create %s\n", filename);

    printf("Press any key exit!");
    getch();
    return 0;
}

此段程序從一個配置文件讀出數(shù)據(jù)后,創(chuàng)建文件,然后把把文件名逐個轉(zhuǎn)為小寫后,去打開文件。
例如 從c:\config.txt 中讀取abcd   轉(zhuǎn)化為大寫后 創(chuàng)建一個文件ABCD  然后用aBCD  abCD abcD abcd去依次打開文件。

我想對Unicode字符進行類似操作  例如羅馬文字    如何修改啊  請大俠指點一下

[ 本帖最后由 ncut220 于 2009-10-15 09:27 編輯 ]

論壇徽章:
0
2 [報告]
發(fā)表于 2009-10-15 14:51 |只看該作者
其實就是tolower 不能轉(zhuǎn)換Unicode字符集    誰能告訴我用什么函數(shù)  謝謝

論壇徽章:
0
3 [報告]
發(fā)表于 2009-10-15 16:59 |只看該作者
mbstowcs 查下這個函數(shù)

論壇徽章:
0
4 [報告]
發(fā)表于 2009-10-15 18:36 |只看該作者
樓主請告訴我, “中國”這2個字的小寫是什么?

論壇徽章:
0
5 [報告]
發(fā)表于 2009-10-16 10:27 |只看該作者

回復(fù) #4 caijimin 的帖子

中國

論壇徽章:
0
6 [報告]
發(fā)表于 2009-10-16 10:37 |只看該作者

回復(fù) #5 langue 的帖子

- -
您需要登錄后才可以回帖 登錄 | 注冊

本版積分規(guī)則 發(fā)表回復(fù)

  

北京盛拓優(yōu)訊信息技術(shù)有限公司. 版權(quán)所有 京ICP備16024965號-6 北京市公安局海淀分局網(wǎng)監(jiān)中心備案編號:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年舉報專區(qū)
中國互聯(lián)網(wǎng)協(xié)會會員  聯(lián)系我們:huangweiwei@itpub.net
感謝所有關(guān)心和支持過ChinaUnix的朋友們 轉(zhuǎn)載本站內(nèi)容請注明原作者名及出處

清除 Cookies - ChinaUnix - Archiver - WAP - TOP