• 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: Terminal and UTF-8
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Terminal and UTF-8


  • Subject: Re: Terminal and UTF-8
  • From: Ondra Cada <email@hidden>
  • Date: Tue, 26 Mar 2002 16:48:31 +0100

On Tuesday, March 26, 2002, at 04:40 , Manfred Lippert wrote:

Uh? getchar() reads a _single_ character from stdin. It simply _can't_
return a whole string: it returns an int.

True. ;-) But the characters of a complete line aren't received by getchar()
until the user hits return in the Terminal. The characters are buffered
somewhere.

they are. So what?

But now I am not sure if the Terminal buffers these characters or if this is
done by the C library.

Actually both, at least so far as you use stdio. But again, so what? If the tool is not UTF-8-aware (and there is hardly any such), it is utterly unimportant how and where the data are buffered: eventually, they come to the tool anyway as some six-byte sequence instead of one Chinese character,
and the tool goes wild. There is *NO* way to dodge that but to re-program the tool using NSStrings (or another API of the same strength).
---
Ondra Cada
OCSoftware: email@hidden http://www.ocs.cz
2K Development: email@hidden http://www.2kdevelopment.cz
private email@hidden http://www.ocs.cz/oc
_______________________________________________
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: 
 >Re: Terminal and UTF-8 (From: Manfred Lippert <email@hidden>)

  • Prev by Date: Re: cocoa-dev digest, Vol 2 #396 - 14 msgs
  • Next by Date: Re: Terminal and UTF-8
  • Previous by thread: Re: Terminal and UTF-8
  • Next by thread: Re: Terminal and UTF-8
  • Index(es):
    • Date
    • Thread