Re: Format of string output of a socket server
- From: "Arkady Frenkel" <arkadyf@xxxxxxxxxxxxxxxx>
- Date: Wed, 4 Oct 2006 09:19:12 +0200
Correct, but that for commands/replies and attachments ( as I wrote base64
is binary coding into 7-bit ASCII) , in command maybe specification of
unicode ( UTF-8 usually ) and that allow to send text in SMTP, so POP3 have
tosupport it, in any language.
Arkady
"m" <m@xxx> wrote in message
news:%236slk%2305GHA.668@xxxxxxxxxxxxxxxxxxxxxxx
POP3 uses 7-bit ASCII. This is NOT the same as 8-bit ANSI or UTF-8.
You can lookup this up easily - I forget the relevant RFCs though.
In general, a socket can ONLY send bytes. How you interpret these bytes
is up to you. If you have to interface with an existing system, then,
obviously, you must conform to that standard.
If you are asking what a _good_ way of doing this is, then, for Windows
systems, I would suggest that you transmit your text as UTF-16 strings.
"Angus" <nospam@xxxxxxxxx> wrote in message
news:%23TKRV8y5GHA.4484@xxxxxxxxxxxxxxxxxxxxxxx
Well... think I am more confused now than when I asked the question ;)
I am talking about what the server will send. I am getting from these
comments that sending bytes (char) is OK. Basically a string response I
would send would be eg "my response\r\n" - ie byte chars followed by
carriage return line feed. I am supposing this is OK.
What for example does your standard POP3 server send? ASCII text just
like
I am saying here?
The client program can then convert to Unicode or whatever they see fit?
Angus
"Alexander Nickolov" <agnickolov@xxxxxxxx> wrote in message
news:OZSOk9x5GHA.3452@xxxxxxxxxxxxxxxxxxxxxxx
UNICODE is the only sane choice of course. However, don'tanything
confuse with the Windows meaning of UNICODE which is
really only the UTF-16 representation of UNICODE. I'd
suggest you use UTF-8 representation of UNICODE to avoid
byte-ordering issues on the network. What you return to
your clients is up to you - you just need to do the appropriate
format conversion (e.g. MultiByteToWideChar to get UTF-16
for example).
--
=====================================
Alexander Nickolov
Microsoft MVP [VC], MCSD
email: agnickolov@xxxxxxxx
MVP VC FAQ: http://www.mvps.org/vcfaq
=====================================
"Angus" <nospam@xxxxxxxxx> wrote in message
news:eXxFh8m5GHA.400@xxxxxxxxxxxxxxxxxxxxxxx
Hello
I am writing a socket server to deliver telephony events to clients on
a
network. For example the telephony server might send out text to
connected
clients. Clients might be written in C/C++, Java, Visual Basic,
otherin
fact which can talk to a socket.
My socket server is currently sending out char* . Do I have to worry
about
the format of string output? Should I be outputting Unicode? Some
format? Or would a C/C++ char* be OK? Will eg Java understand it?
Do
they
use UTF-8 or something?
Angus
.
- References:
- Format of string output of a socket server
- From: Angus
- Re: Format of string output of a socket server
- From: Alexander Nickolov
- Re: Format of string output of a socket server
- From: Angus
- Re: Format of string output of a socket server
- From: m
- Format of string output of a socket server
- Prev by Date: Re: asynchronous socket I/O call which returns immediately without WSA_IO_PENDING
- Next by Date: Re: overlapped send fails with "Overlapped I/O operation is in progress."
- Previous by thread: Re: Format of string output of a socket server
- Next by thread: asynchronous socket I/O call which returns immediately without WSA_IO_PENDING
- Index(es):
Relevant Pages
|