comparison src/fns.c @ 61433:74a256d5f3ec

(Fstring_as_multibyte, Fstring_to_multibyte): Docstring fixes.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Sun, 10 Apr 2005 19:02:24 +0000
parents 93f7c57762e3
children aef105b11011 146c086df160
comparison
equal deleted inserted replaced
61432:7279141eb80e 61433:74a256d5f3ec
1 /* Random utility Lisp functions. 1 /* Random utility Lisp functions.
2 Copyright (C) 1985, 86, 87, 93, 94, 95, 97, 98, 99, 2000, 2001, 02, 03, 2004 2 Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1997, 1998, 1999, 2000,
3 Free Software Foundation, Inc. 3 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
4 4
5 This file is part of GNU Emacs. 5 This file is part of GNU Emacs.
6 6
7 GNU Emacs is free software; you can redistribute it and/or modify 7 GNU Emacs is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by 8 it under the terms of the GNU General Public License as published by
1146 doc: /* Return a multibyte string with the same individual bytes as STRING. 1146 doc: /* Return a multibyte string with the same individual bytes as STRING.
1147 If STRING is multibyte, the result is STRING itself. 1147 If STRING is multibyte, the result is STRING itself.
1148 Otherwise it is a newly created string, with no text properties. 1148 Otherwise it is a newly created string, with no text properties.
1149 If STRING is unibyte and contains an individual 8-bit byte (i.e. not 1149 If STRING is unibyte and contains an individual 8-bit byte (i.e. not
1150 part of a multibyte form), it is converted to the corresponding 1150 part of a multibyte form), it is converted to the corresponding
1151 multibyte character of charset `eight-bit-control' or `eight-bit-graphic'. */) 1151 multibyte character of charset `eight-bit-control' or `eight-bit-graphic'.
1152 Beware, this often doesn't really do what you think it does.
1153 It is similar to (decode-coding-string STRING 'emacs-mule-unix).
1154 If you're not sure, whether to use `string-as-multibyte' or
1155 `string-to-multibyte', use `string-to-multibyte'. Beware:
1156 (aref (string-as-multibyte "\201") 0) -> 129 (aka ?\201)
1157 (aref (string-as-multibyte "\300") 0) -> 192 (aka ?\300)
1158 (aref (string-as-multibyte "\300\201") 0) -> 192 (aka ?\300)
1159 (aref (string-as-multibyte "\300\201") 1) -> 129 (aka ?\201)
1160 but
1161 (aref (string-as-multibyte "\201\300") 0) -> 2240
1162 (aref (string-as-multibyte "\201\300") 1) -> <error> */)
1152 (string) 1163 (string)
1153 Lisp_Object string; 1164 Lisp_Object string;
1154 { 1165 {
1155 CHECK_STRING (string); 1166 CHECK_STRING (string);
1156 1167
1180 If STRING is multibyte, the result is STRING itself. 1191 If STRING is multibyte, the result is STRING itself.
1181 Otherwise it is a newly created string, with no text properties. 1192 Otherwise it is a newly created string, with no text properties.
1182 Characters 0200 through 0237 are converted to eight-bit-control 1193 Characters 0200 through 0237 are converted to eight-bit-control
1183 characters of the same character code. Characters 0240 through 0377 1194 characters of the same character code. Characters 0240 through 0377
1184 are converted to eight-bit-graphic characters of the same character 1195 are converted to eight-bit-graphic characters of the same character
1185 codes. */) 1196 codes.
1197 This is similar to (decode-coding-string STRING 'binary) */)
1186 (string) 1198 (string)
1187 Lisp_Object string; 1199 Lisp_Object string;
1188 { 1200 {
1189 CHECK_STRING (string); 1201 CHECK_STRING (string);
1190 1202