是否有任何C / C ++ system()函数接受UNI code? [英] Is there any C/C++ system() function accepting unicode?

查看:145
本文介绍了是否有任何C / C ++ system()函数接受UNI code?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问题:在C / C ++,有一个接受的Uni code的任何系统的功能?
请参阅以下原因:

 的#include<&stdio.h中GT;
#包括LT&;&stdlib.h中GT;
INT主(INT ARGC,CHAR *的argv [])
{
    // http://stackoverflow.com/questions/3313332/bringing-another-apps-window-to-front-on-mac-in-c
    系统(osascript -e \\告诉应用程序\\\\\\通讯簿\\\\\\启动\\);
    返回EXIT_SUCCESS;
}


解决方案

系统()不关心编码,据我所知,它应该只是让它通过。

也许你的问题是如何键入一个UTF-8字符串使用C文字,或者什么编码呢osascript期望?

便携方式在C ++做的UTF-8是\\点¯x转义序列,但如果你愿意依靠C99或特定的编译器通常可以键入UTF-8,直接。

我猜osascript预计UTF-8,虽然我没有真正的想法。

Question: In C/C++, is there any system function that accepts Unicode ? See below for reason:

#include <stdio.h>
#include <stdlib.h>


int main(int argc, char* argv[])
{
    // http://stackoverflow.com/questions/3313332/bringing-another-apps-window-to-front-on-mac-in-c
    system("osascript -e \"tell application \\\"Address Book\\\" to activate\"");
    return EXIT_SUCCESS;
}

解决方案

system() does not care about the encoding as far as I know, it should just pass it through.

maybe your question is "how to type a UTF-8 string literal in C", or "what encoding does osascript expect"?

the portable way to do UTF-8 in C is with \x escape sequences, though if you are willing to rely on C99 or a specific compiler you can often type the UTF-8 directly.

I would guess osascript expects UTF-8 though I have no real idea.

这篇关于是否有任何C / C ++ system()函数接受UNI code?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆