Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <pre><code>String user = new String ("boo"); </code></pre> <p>You don't need to (and shouldn't) do <code>new String</code> in Java—<code>String user = "boo";</code> is fine.</p> <pre><code>String msg = new String("你的哈达哈达!"); </code></pre> <p>Writing non-ASCII characters in your source means that you have to get the <code>-encoding</code> flag to <code>javac</code> to match the encoding you have saved your text files with. It is possible you have saved the .java file as UTF-8 but not configured your build environment to use UTF-8 at compile time.</p> <p>If you are not sure that you've got this right, you can use ASCII-safe <code>\u</code> escapes in the meantime:</p> <pre><code>String msg = "\u4F60\u7684\u54C8\u8FBE\u54C8\u8FBE!"; // 你的哈达哈达! </code></pre> <p>Finally:</p> <pre><code>URI myUrl = new URI("http://www.isms.com.my/isms_send.php?un=" + user + "&amp;pwd=" + pass + "&amp;dstno=" + dstno + "&amp;msg=" + msg + "&amp;type=" + type + "&amp;sendid=" + sendid); </code></pre> <p>When you're putting a URI together you should URL-escape each of the parameters you include in the string. Otherwise any <code>&amp;</code> or other invalid character in the value will break the query. This also allows you to choose what charset is used to create the query string.</p> <pre><code>String enc = "UTF-8"; URI myUrl = new URI("http://www.isms.com.my/isms_send.php?" + "un=" + URLEncoder.encode(user, enc) + "&amp;pwd=" + URLEncoder.encode(pass, enc) + "&amp;dstno=" + URLEncoder.encode(dstno, enc) + "&amp;msg=" + URLEncoder.encode(msg, enc) + "&amp;type=" + URLEncoder.encode(Integer.toString(type), enc) + "&amp;sendid=" + URLEncoder.encode(sendid, enc) ); </code></pre> <p>What the right value for <code>enc</code> is depends on the service you are connecting to, but <code>UTF-8</code> is a good guess.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload