Skip navigation.
 
mlRe: What is this invisible character?
FROM : Jens Alfke
DATE : Wed Mar 19 19:34:25 2008

On 19 Mar '08, at 10:04 AM, J. Todd Slack wrote:

> How do I write an ASCII 254 and ASCII 255 at the beginning of the 
> NSString
> that I am putting in the file I want to be read back in at a later 
> date? '


Those wouldn't go into the NSString; they're the byte-order-mark that 
prefixes the UTF-16 data, not part of the character data itself.

I really recommend you write out the string in UTF-8 instead, as I 
suggested yesterday (with example code). UTF-8 is the most common 
modern encoding for text, because (a) it's a superset of ascii, and 
(b) for Roman alphabets it's up to twice as compact as UTF-16.

—Jens

Related mailsAuthorDate
mlWhat is this invisible character? J. Todd Slack Mar 19, 05:34
mlRe: What is this invisible character? stephen joseph but… Mar 19, 05:41
mlRe: What is this invisible character? Andrew Merenbach Mar 19, 05:45
mlRe: What is this invisible character? J. Todd Slack Mar 19, 05:53
mlRe: What is this invisible character? stephen joseph but… Mar 19, 05:57
mlRe: What is this invisible character? Jens Alfke Mar 19, 06:47
mlRe: What is this invisible character? J. Todd Slack Mar 19, 18:04
mlRe: What is this invisible character? stephen joseph but… Mar 19, 18:11
mlRe: What is this invisible character? Jens Alfke Mar 19, 19:34
mlRe: What is this invisible character? Deborah Goldsmith Mar 25, 01:59