如何PrintWriter编写UTF-8?
pstream = new PrintWriter(csocket.getOutputStream(), true);
String res = "some string";
pstream.println(res); // here I want to output string as UTF-8
Run Code Online (Sandbox Code Playgroud) jar cvef Main.jar Main *
added manifest
adding: DrawPane.class(in = 344) (out= 257)(deflated 25%)
adding: DrawPane.java(in = 306) (out= 175)(deflated 42%)
adding: main(in = 9038) (out= 8275)(deflated 8%)
adding: Main.class(in = 868) (out= 544)(deflated 37%)
adding: Main.java(in = 507) (out= 260)(deflated 48%)
adding: Manifest.txt(in = 18) (out= 18)(deflated 0%)
adding: src/(in = 0) (out= 0)(stored 0%)
adding: src/icon.png(in = 1163) (out= 1168)(deflated 0%)
adding: src/Thumbs.db(in = 3584) (out= 1038)(deflated 71%)
Run Code Online (Sandbox Code Playgroud)
创建jar文件,然后:
java -jar Main.jar
Run Code Online (Sandbox Code Playgroud)
我收到一个错误:
no main manifest attribute, in …Run Code Online (Sandbox Code Playgroud) <script href="http://code.jquery.com/jquery-1.10.2.min.js"></script>
<script>
console.log($);
console.log(jQuery);
</script>
Run Code Online (Sandbox Code Playgroud)
我收到的消息是$或jQuery未定义:出了什么问题?
它只是一个空的index.html,没有其他代码.
为什么在类JRoute中没有带_的方法,但我们使用它?,类JRoute只扩展了JObjects,但_函数在哪里?在joomla
当我写一些西里尔文本,System.out.println("Русскийязык") - 然后它推出这个╨єёёъшщч√ъ,使用Windows控制台,怎么可以这个修复?,文件编码是utf-8,但它没关系,当它是ansii或windows-1251时,输出相同.
$('.register_form').validate({
invalidHandler: function(){
return false;
}
Run Code Online (Sandbox Code Playgroud)
我试过这个但是没有用,如何删除错误信息,而是将输入边框变为红色?没有在docs上找到例子
private String pattern = @"^{(.*)|(.*)}$";
ret = groups[0].Captures.Count.ToString(); // returns 1
Run Code Online (Sandbox Code Playgroud)
是不是应该返回2次捕获?因为()我的RegExp中有两个?
我的字符串例如:
{test1 | test2}
Run Code Online (Sandbox Code Playgroud)
第一次捕获应该是test1和secnd test2,但我得到整个字符串作为回报,捕获计数是1为什么是这样?
更新:
Regex rgx = new Regex(pattern, RegexOptions.IgnoreCase);
MatchCollection matches = rgx.Matches(_sourceString);
String ret = "";
foreach (Match match in matches)
{
GroupCollection groups = match.Groups;
ret = groups[0].Captures[0].Value;
}
return ret; //returns the whole string, but I've expected 'test1'
Run Code Online (Sandbox Code Playgroud) 邮件程序错误:无法执行:/ usr/sbin/sendmail
我使用的是debian服务器,文件权限是777(全部都有),所以我无法执行它为什么会这样?
//Create a new PHPMailer instance
$mail = new PHPMailer();
// Set PHPMailer to use the sendmail transport
$mail->isSendmail();
//Set who the message is to be sent from
$mail->setFrom('admin@test.com', 'test');
//Set an alternative reply-to address
//$mail->addReplyTo('replyto@example.com', 'First Last');
//Set who the message is to be sent to
$mail->addAddress($_POST['email'], $_POST['name']);
//Set the subject line
$mail->Subject = 'PHPMailer sendmail test';
//Read an HTML message body from an external file, convert referenced images to embedded,
//convert HTML into a basic plain-text …Run Code Online (Sandbox Code Playgroud) preg_match('/^[\p{L}\s]+$/u', '????? ENGLISH STRING', $matches);
Run Code Online (Sandbox Code Playgroud)
这里它匹配所有字符西里尔语和拉丁语,为什么它们没有被过滤?,文件编码是utf-8,我做错了什么?