• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: A question about encoding
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: A question about encoding


  • Subject: Re: A question about encoding
  • From: Hiro Fujimoto <email@hidden>
  • Date: Fri, 19 Mar 2004 06:08:45 +0900

Hi. zhengjl,

You can encode the contents of file using - initWithBytes:length:encoding: method of NSString .

--

On 2004/03/18, at 18:50, zhengjl wrote:

Hi! cocoa-dev:

I met a question about display messages on NSTextView which saved in a text file.
I use fuction freopen() to make cupstestppd output to a text file. but when i try to get the contents of the file and display on NSTextView (as below):
[resultField setString:[NSString stringWithContentsOfFile: filePath]];
I found that it can not get string if the file has encoding characters. (if file without encoding characters, the sentence works well)

Program entironment:
Mac OS X 10.3 (Chinese)
XCode and Interface Builder
Cocoa and cups source code

Best Regard !

------------------------------------------------------------------------ ---------
hiro FUJIMOTO - developer in Japan.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.


References: 
 >A question about encoding (From: "zhengjl" <email@hidden>)

  • Prev by Date: Re: substring return a new string?
  • Next by Date: Re: customizing visual feedback in nstableview
  • Previous by thread: A question about encoding
  • Next by thread: customizing visual feedback in nstableview
  • Index(es):
    • Date
    • Thread