Revision 27097
- Date:
- 2009/06/16 20:32:37
- Files:
Legend:
- Added
- Removed
- Modified
-
docs/Perl6/Spec/S32-setting-library/Str.pod
229 229 Returns the number of bytes in the string if it were encoded in the 230 230 specified way. Note the inequality: 231 231 232 .bytes("C","UTF-16") * 2 >= .codes("C") 232 .bytes("UTF-16","C") * 2 >= .codes("C") 233 233 234 234 This is caused by the possibility of surrogate pairs, which are counted as one 235 235 codepoint. However, this problem does not arise for UTF-32: 236 236 237 .bytes("C","UTF-32") * 4 == .codes("C") 237 .bytes("UTF-32","C") * 4 == .codes("C") 238 238 239 239 =item encode 240 240 241 our Buf multi method encode($encoding = 'UTF-8', $nf = $?NF) 241 our Buf multi method encode($encoding = $?ENC, $nf = $?NF) 242 242 243 243 Returns a C<Buf> which represents the original string in the given encoding 244 244 and normal form.