Path: utzoo!mnetor!uunet!lll-winken!lll-tis!ames!nrl-cmf!cmcl2!brl-adm!umd5!purdue!i.cc.purdue.edu!j.cc.purdue.edu!pur-ee!uiucdcs!uxc.cso.uiuc.edu!uxe.cso.uiuc.edu!leonardr From: leonardr@uxe.cso.uiuc.edu Newsgroups: comp.sys.mac.programmer Subject: Re: TWO Byte Characters, SysEnvirons -- Message-ID: <226000007@uxe.cso.uiuc.edu> Date: 13 Apr 88 14:47:00 GMT References: <742@unioncs.UUCP> Lines: 34 Nf-ID: #R:unioncs.UUCP:742:uxe.cso.uiuc.edu:226000007:000:1697 Nf-From: uxe.cso.uiuc.edu!leonardr Apr 13 08:47:00 1988 shinberd@unioncs.UUCP(Dave Shinberg) writes in comp.sys.mac.programmer >I have been struggling with a seemingly simple problem for over two >weeks now. > >How to put characters into a plain text file. Open (and possibly create) the file you wish to write to and then use FSWrite with the number of bytes you wish to write to that file. > After some time I've >narrowed the problem down to the fact that a character occupies TWO BYTE >in MPW Pascal 2.0. Since the program is only intended to be used in English >I have no need for this. It also appears that some aplications such MPW itself >does not recognize two byte characters in a text file. > >My two questions are: > >1) I think my problem is with the SysEnvirons, but I am not totaly sure. > Not SysEnvirions, but the Environs information having to do with the Script Manager. They are two different things and Apple was nice enough to give them similiar names to confuse people. >2) How does TextEdit deal with these tow byte characters and why do some > applications seem to deal only with one byte characters? TextEdit (like all good programs) uses the routines in the Script Manager (See IM V for more info) to handle drawing and processing its Text. The Script Manager (and its Interface files) allow QuickDraw to handle multibyte chars as well as such linguistical features are Right-to-Left typing. If an application does not use the Script Manager and instead relies on its own editing routines (9 of 10 word processors surveyed) which assume that all chars are only one byte, then problems occur if you try to do two-byte character editing (Chinese and Japanese chars on the Mac are handled as Two-byte chars).