使用完整的C++ i18n gettext()"hello world"示例我将语言环境从" es_MX
"改为" pl_PL
",文本改为"hello,world!" "输入无效.输入一个至少20个字符的字符串." 波兰语翻译包含几个导致msgfmt"łąźó"的"无效多字节序列"错误的字符.翻译的文本是从网页复制的.
我认为utf8是问题所在.如果是这样,应该使用什么呢?
cat >plt.cxx <<EOF
// plt.cxx
#include <libintl.h>
#include <locale.h>
#include <iostream>
int main (){
setlocale(LC_ALL, "");
bindtextdomain("plt", ".");
textdomain( "plt");
std::cout << gettext("Invalid input. Enter a string at least 20 characters long.") << std::endl;
}
EOF
g++ -o plt plt.cxx
xgettext --package-name plt --package-version 1.2 --default-domain plt --output plt.pot plt.cxx
msginit --no-translator --locale pl_PL --output-file plt_polish.po --input plt.pot
sed --in-place plt_polish.po --expression='/#: /,$ s/""/"Nieprawid?owo wprowadzone dane. Wprowad? …
Run Code Online (Sandbox Code Playgroud) 我有一个客户端正在运行PCI兼容性扫描并获得以下内容:
BEAST (Browser Exploit Against SSL/TLS) Vulnerability
The SSL protocol encrypts data by using CBC mode with chained
initialization vectors. This allows an attacker, which is has gotten
access to an HTTPS session via man-in-the-middle (MITM) attacks or other means, to obtain plain text HTTP headers via
a blockwise chosen-boundary attack (BCBA) in conjunction with
Javascript code that uses the HTML5 WebSocket API, the Java
URLConnection API, or the Silverlight WebClient API. This
vulnerability is more commonly referred to as …
Run Code Online (Sandbox Code Playgroud) C++ 17添加十六进制浮点常量(浮点字面值).为什么?几个显示好处的例子怎么样?
我们在OpenVMS Alpha和Integrity服务器上运行批处理文件.到目前为止,它们都是用COBOL编写的.您可以想象,有很多原因导致无法维持该过程.
与此同时,我们拥有一支使用Eclipse并且非常了解Java的开发人员团队.是否可以将Eclipse与OpenVMS一起使用?
来自Rick Rogers的O'Reilly着作"Android应用程序开发",John Lombardo,Zigurd Mednieks和Blake Meike,第44页:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.microjobsinc.mjandroid" android:versionCode="1"
android:versionName="1.0">
Run Code Online (Sandbox Code Playgroud)
上面的XML代码具有该package
属性.但是,在XML的其余部分中,其余属性都具有命名空间.
为什么所有属性都有一个名称空间除外package
?
msginit提示输入电子邮件地址.有没有办法告诉msginit使用什么电子邮件地址而不提示它,如命令行参数?
cat >hellogt.cxx <<EOF
// hellogt.cxx
#include <libintl.h>
#include <locale.h>
#include <iostream>
int main (){
setlocale(LC_ALL, "");
bindtextdomain("hellogt", "./");
textdomain( "hellogt" );
std::cout << gettext("hello, world!") << std::endl;
}
EOF
g++ -ohellogt hellogt.cxx
xgettext -d hellogt -o hellogt.pot hellogt.cxx
msginit -l es_MX -o spanish.po -i hellogt.pot
Run Code Online (Sandbox Code Playgroud) 通过手动编辑模板文件中的MIME Content-Type字符集来纠正波兰文本上的msgfmt"无效多字节序列"错误.是否有一些用于设置MIME类型的xgettext,msginit,msgfmt序列的命令或选项?
cat >plt.cxx <<EOF
// plt.cxx
#include <libintl.h>
#include <locale.h>
#include <iostream>
int main (){
setlocale(LC_ALL, "");
bindtextdomain("plt", ".");
textdomain( "plt");
std::cout << gettext("Invalid input. Enter a string at least 20 characters long.") << std::endl;
}
EOF
g++ -o plt plt.cxx
xgettext --package-name plt --package-version 1.2 --default-domain plt --output plt.pot plt.cxx
sed --in-place plt.pot --expression='s/CHARSET/UTF-8/'
msginit --no-translator --locale pl_PL --output-file plt_polish.po --input plt.pot
sed --in-place plt_polish.po --expression='/#: /,$ s/""/"Nieprawid?owo wprowadzone dane. Wprowad? ci?g przynajmniej 20 znaków."/'
mkdir …
Run Code Online (Sandbox Code Playgroud) 如何使用jQuery选择上下文节点的特定兄弟?具体来说,给定上下文节点myContextNode
选择span
带有类的兄弟myClass
.
document.evaluate("../span[@class='myClass']",
myContextNode, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).
singleNodeValue;
Run Code Online (Sandbox Code Playgroud) 流体布局上的Twitter Bootstrap Scaffolding部分显示了显示为两个蓝色框的示例代码.使用该示例,下面的代码显示"补充工具栏内容正文内容",但没有框.还需要什么?
<!DOCTYPE html>
<html>
<head>
<link href="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.1/css/bootstrap-combined.no-iconhttp://twitter.github.io/bootstrap/scaffolding.htmls.min.css" rel="stylesheet">
</head>
<body>
<div class="container-fluid">
<div class="row-fluid">
<div class="span2">
Sidebar content
</div>
<div class="span10">
Body content
</div>
</div>
</div>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script src="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.1/js/bootstrap.min.js"></script>
</body>
</html>
Run Code Online (Sandbox Code Playgroud) 如果您运行的是 64 位版本的 Ubuntu,则需要使用以下命令安装一些 32 位库:
Run Code Online (Sandbox Code Playgroud)sudo apt-get install libc6:i386 libncurses5:i386 libstdc++6:i386 lib32z1 libbz2-1.0:i386
将apt-get install
失败:
$ sudo apt-get install libc6:i386 libncurses5:i386 libstdc++6:i386 lib32z1 libbz2-1.0:i386
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package libc6:i386
E: Unable to locate package libncurses5:i386
E: Unable to locate package libstdc++6:i386
E: Couldn't find any package by regex 'libstdc++6'
E: Unable to locate package libbz2-1.0:i386
E: Couldn't find any package …
Run Code Online (Sandbox Code Playgroud)