]> Cypherpunks repositories - gostls13.git/commitdiff
SVN=112717
authorRob Pike <r@golang.org>
Mon, 17 Mar 2008 04:47:38 +0000 (21:47 -0700)
committerRob Pike <r@golang.org>
Mon, 17 Mar 2008 04:47:38 +0000 (21:47 -0700)
doc/go_lang.txt

index 651e5f82dbb999cb29734ee9071940846b0291b5..b6925006a228e800cfd6f6cf04bb891dcd09912b 100644 (file)
@@ -368,8 +368,9 @@ A string behaves like an array of bytes, with the following properties:
 - Known length: the length of a string s1 can be obtained by the function/
   operator len(s1).  The length of a string is the number of bytes within.
   Unlike in C, there is no terminal NUL byte.
-- Creation 1: a string can be created from an integer value by a conversion
-    string('x') yields "x"
+- Creation 1: a string can be created from an integer value by a conversion;
+  the result is a string containing the UTF-8 encoding of that code point.
+    string('x') yields "x"; string(0x1234) yields the equivalent of "\u1234"
 - Creation 2: a string can by created from an array of integer values (maybe
   just array of bytes) by a conversion
     a [3]byte; a[0] = 'a'; a[1] = 'b'; a[2] = 'c';  string(a) == "abc";