Mercurial > emacs
comparison src/mac.c @ 64553:58cbcf3e6ed1
(Fmac_code_convert_string): Add comment about Fstring_as_unibyte.
author | Stefan Monnier <monnier@iro.umontreal.ca> |
---|---|
date | Thu, 21 Jul 2005 05:36:04 +0000 |
parents | a673f66d6156 |
children | b9746f88defa 187d6a1f84f7 |
comparison
equal
deleted
inserted
replaced
64552:6d2fdf6cf1f2 | 64553:58cbcf3e6ed1 |
---|---|
1 /* Unix emulation routines for GNU Emacs on the Mac OS. | 1 /* Unix emulation routines for GNU Emacs on the Mac OS. |
2 Copyright (C) 2000, 2001 Free Software Foundation, Inc. | 2 Copyright (C) 2000, 2001, 2005 Free Software Foundation, Inc. |
3 | 3 |
4 This file is part of GNU Emacs. | 4 This file is part of GNU Emacs. |
5 | 5 |
6 GNU Emacs is free software; you can redistribute it and/or modify | 6 GNU Emacs is free software; you can redistribute it and/or modify |
7 it under the terms of the GNU General Public License as published by | 7 it under the terms of the GNU General Public License as published by |
4142 BLOCK_INPUT; | 4142 BLOCK_INPUT; |
4143 | 4143 |
4144 src_encoding = get_cfstring_encoding_from_lisp (source); | 4144 src_encoding = get_cfstring_encoding_from_lisp (source); |
4145 tgt_encoding = get_cfstring_encoding_from_lisp (target); | 4145 tgt_encoding = get_cfstring_encoding_from_lisp (target); |
4146 | 4146 |
4147 /* We really want string_to_unibyte, but since it doesn't exist yet, we | |
4148 use string_as_unibyte which works as well, except for the fact that | |
4149 it's too permissive (it doesn't check that the multibyte string only | |
4150 contain single-byte chars). */ | |
4147 string = Fstring_as_unibyte (string); | 4151 string = Fstring_as_unibyte (string); |
4148 if (src_encoding != kCFStringEncodingInvalidId | 4152 if (src_encoding != kCFStringEncodingInvalidId |
4149 && tgt_encoding != kCFStringEncodingInvalidId) | 4153 && tgt_encoding != kCFStringEncodingInvalidId) |
4150 str = CFStringCreateWithBytes (NULL, SDATA (string), SBYTES (string), | 4154 str = CFStringCreateWithBytes (NULL, SDATA (string), SBYTES (string), |
4151 src_encoding, true); | 4155 src_encoding, true); |