As per Relevance of the word indicated, we have this rfc below:











Network Working Group R.
Request for Comments: 2066
Category: Experimental January 1997


TELNET CHARSET

Status of this

This memo defines an Experimental Protocol for the
community. This memo does not specify an Internet standard of
kind. Discussion and suggestions for improvement are requested
Distribution of this memo is unlimited



This document specifies a mechanism for passing character set
translation information between a TELNET client and server. Use
this mechanism enables an application used by a TELNET user to
and receive data in the correct character set

Either side can (subject to option negotiation) at any time
that a (new) character set be used

1. Command Names and

CHARSET.......................42

REQUEST ....................01
ACCEPTED ...................02
REJECTED ...................03
TTABLE-IS ..................04
TTABLE-REJECTED ............05
TTABLE-ACK .................06
TTABLE-NAK .................07

As a convenience, standard TELNET text and codes for commands used
this document are reproduced here (excerpted from [1]):

All TELNET commands consist of at least a two byte sequence:
"Interpret as Command" (IAC) escape character followed by the
for the command. The commands dealing with option negotiation
three byte sequences, the third byte being the code for the
referenced. ... [O]nly the IAC need be doubled to be sent as data
and the other 255 codes may be passed transparently.
following are [some of] the defined TELNET commands. Note
these codes and code sequences have the indicated meaning
when immediately preceded by an IAC



Gellens Experimental [Page 1]

RFC 2066 TELNET CHARSET Option January 1997


NAME CODE

SE 240 End of subnegotiation parameters

SB 250 Indicates that what follows
subnegotiation of the
option

WILL 251 Indicates the desire to
performing, or confirmation
you are now performing,
indicated option

WON'T 252 Indicates the refusal to perform
or continue performing,
indicated option

DO 253 Indicates the request that
other party perform,
confirmation that you are
the other party to perform,
indicated option

DON'T 254 Indicates the demand that the
party stop performing,
confirmation that you are no
expecting the other party
perform, the indicated option

IAC 255 Data Byte 255.

2. Command

A very simple meta-syntax is used, where most tokens
previously defined items (such as IAC); angle-brackets ("<>")
used for items to be further defined; curly-braces ("{}") are
around optional items; ellipses represent repeated sequences
items; and quotes are used for literal strings

IAC WILL
The sender REQUESTS permission to, or AGREES to,
CHARSET option subnegotiation to choose a character set


IAC WON'T
The sender REFUSES to use CHARSET option
to choose a character set




Gellens Experimental [Page 2]

RFC 2066 TELNET CHARSET Option January 1997


IAC DO
The sender REQUESTS that, or AGREES to have, the
side use CHARSET option subnegotiation to choose
character set


IAC DON'T
The sender DEMANDS that the other side not use
CHARSET option subnegotiation


IAC SB CHARSET REQUEST { "[TTABLE ]" } list> IAC

Char set list

<character set> { ... <character set> }

This message initiates a new CHARSET subnegotiation. It can only
sent by a side that has received a DO CHARSET message and sent a
CHARSET message (in either order).

The sender requests that all text sent to and by it be encoded in
of the specified character sets

If the string [TTABLE] appears, the sender is willing to accept
mapping (translation table) between any character set listed in <
set list> and any character set desired by the receiver

is an octet whose binary value is the highest
level of the TTABLE-IS message which can be sent in response.
field must not be zero. See the TTABLE-IS message for the
version values

is a sequence of 7-BIT ASCII printable characters
The first octet defines the separator character (which must
appear within any character set). It is terminated by the IAC
sequence. Case is not significant. It consists of one or
character sets. The character sets should appear in order
preference (most preferred first).

is a separator octet, the value of which is chosen by
sender. Examples include a space or a semicolon. Any value
than IAC is allowed. The obvious choice is a space or any
punctuation symbol which does not appear in any of the character
names





Gellens Experimental [Page 3]

RFC 2066 TELNET CHARSET Option January 1997


<Character set> is a sequence of 7-BIT ASCII printable characters
Case is not significant

If a requested character set name does not start with "X-" or "x-",
it MUST be registered with the Internet Assigned Number
(IANA) [2].

The receiver responds in one of four ways

If the receiver is already sending text to and expecting text
the sender to be encoded in one of the specified character sets,
sends a positive acknowledgment (CHARSET ACCEPTED); it MUST
ignore the message. (Although ignoring the message is
suggested by some interpretations of the relevant RFCs ([1], [3]),
the interests of determinacy it is not permitted. This ensures
the issuer does not need to time out and infer a response,
avoiding (because there is no response to a positive acknowledgment
the non-terminating subnegotiation which is the rationale in the
for the non-response behavior.)

If the receiver is capable of handling at least one of the
character sets, it can respond with a positive acknowledgment for
of the requested character sets. Normally, it should pick the
set it is capable of handling but may choose one based on its
preferences. After doing so, each side MUST encode subsequent
in the specified character set

If the string [TTABLE] is present, and the receiver prefers to use
character set not included in , and is capable
doing so, it can send a translate table (TTABLE-IS) response

If the receiver is not capable of handling any of the
character sets, it sends a negative acknowledgment (
REJECTED).

Because it is not valid to reply to a CHARSET REQUEST message
another CHARSET REQUEST message, if a CHARSET REQUEST message
received after sending one, it means that both sides have sent
simultaneously. In this case, the server side MUST issue a
acknowledgment. The client side MUST respond to the one from
server

IAC SB CHARSET ACCEPTED IAC
This is a positive acknowledgment response to a CHARSET
message; the receiver of the CHARSET REQUEST message
its receipt and accepts the indicated character set





Gellens Experimental [Page 4]

RFC 2066 TELNET CHARSET Option January 1997


is a character sequence identical to one of
character sets in the CHARSET REQUEST message. It is
by the IAC SE sequence

Text messages which follow this response must now be coded in
indicated character set. This message terminates the
CHARSET subnegotiation

IAC SB CHARSET REJECTED IAC
This is a negative acknowledgment response to a CHARSET
message; the receiver of the CHARSET REQUEST message
its receipt but refuses to use any of the requested
sets. Messages can not be sent in any of the indicated
sets. This message can also be sent by the sender of a TTABLE-
message, if multiple TTABLE-NAK messages were sent in response
This message terminates the current CHARSET subnegotiation

IAC SB CHARSET TTABLE-IS IAC
In response to a CHARSET REQUEST message in which [TTABLE]
specified, the receiver of the CHARSET REQUEST
acknowledges its receipt and is transmitting a pair of
which define the mapping between specified character sets

is an octet whose binary value is the version level
this TTABLE-IS message. Different versions have different syntax
The lowest version level is one (zero is not valid). The
highest version level is also one. This field is provided so
future versions of the TTABLE-SEND message can be specified,
example, to handle character sets for which there is no
one-to-one character-for-character translation. This
include some forms of multi-octet character sets for
translation algorithms or subsets need to be sent

Syntax for Version 1:

< char size 1> < char count 1> <
set name 2>

is a separator octet, the value of which is chosen by
sender. Examples include a space or a semicolon. Any value
than IAC is allowed. The obvious choice is a space or any
punctuation symbol which does not appear in either of
character set names

and are sequences of 7-
ASCII printable characters which identify the two character
for which a mapping is being specified. Each is terminated
. Case is not significant. If a character set name does



Gellens Experimental [Page 5]

RFC 2066 TELNET CHARSET Option January 1997


start with "X-" or "x-", it MUST be registered with IANA. <
set name 1> MUST be chosen from the in the
REQUEST message. can be arbitrarily chosen
Text on the wire MUST be encoded using .

and are single octets each.
binary value of the octet is the number of bits
required for each character in the corresponding table. It
be a multiple of eight

and are each three-octet
fields in Network Byte Order [6]. Each specifies how
characters (of the maximum 2**) are being
in the corresponding map

and each consist of the corresponding number of characters. These characters form a mapping from all
part of the characters in one of the specified character sets
the correct characters in the other character set. If
indicated is less than 2**, the
characters are being mapped, and the
characters are assumed to not be changed (and thus map
themselves). That is, each map contains characters 0
-1. maps from to name 2>. maps from to 1>. Translation between the character sets is thus an
process of using the binary value of a character as an index
the appropriate map. The character at that index replaces
original character. If the index exceeds the for
map, no translation is performed for the character

[Note to implementers: since TELNET works in octets, it
possible for octets of value 255 to appear "spontaneously"
using multi-octet or non-8-bit characters. All octets of
255 (other than IAC) MUST be quoted to conform with
requirements. This applies even to octets within a table, or
in a multi-octet character set.]

IAC SB CHARSET TTABLE-ACK IAC
The sender acknowledges the successful receipt of the
table. Text messages which follow this response must now be
in the character set specified as of
TTABLE-IS message. This message terminates the current
subnegotiation







Gellens Experimental [Page 6]

RFC 2066 TELNET CHARSET Option January 1997


IAC SB CHARSET TTABLE-NAK IAC
The sender reports the unsuccessful receipt of the translate
and requests that it be resent. If subsequent
attempts also fail, a TTABLE-REJECTED or CHARSET REJECTED
(depending on which side sends it) should be sent instead
additional futile TTABLE-IS and TTABLE-NAK messages

IAC SB CHARSET TTABLE-REJECTED IAC
In response to a TTABLE-IS message, the receiver of the TTABLE-
message acknowledges its receipt and indicates it is unable
handle it. This message terminates the current
subnegotiation

Any system which supports the CHARSET option MUST fully
the CHARSET REQUEST, ACCEPTED, REJECTED, and TTABLE-
subnegotiation messages. It MAY optionally fully support
TTABLE-IS, TTABLE-ACK, and TTABLE-NAK messages. If it does
support the TTABLE-IS message, it MUST also fully support
TTABLE-ACK and TTABLE-NAK messages

3.

WON'T

DON'T

4. Motivation for the

Many TELNET sessions need to transmit data which is not in 7-
ASCII. This is usually done by negotiating BINARY, and using
conventions (or terminal type kluges) to determine the character
of the data. However, such methods tend not to interoperate well
and have difficulties when multiple character sets need to
supported by different sessions

Many computer systems now utilize a variety of character sets
Increasingly, a server computer needs to document character sets
translate transmissions and receptions using different pairs
character sets on a per-application or per-connection basis. This
becoming more common as client and server computers become
geographically disperse. (And as servers are consolidated
ever-larger hubs, serving ever-wider areas.) In order for files
databases, etc. to contain correct data, the server must
the character set in which the user is sending, and the character
in which the application expects to receive






Gellens Experimental [Page 7]

RFC 2066 TELNET CHARSET Option January 1997


In some cases, it is sufficient to determine the character set of
end user (because every application on the server expects to use
same character set, or because applications can handle the user'
character set), but in other cases different server
expect to use different character sets. In the former case,
initial CHARSET subnegotiation suffices. In the latter case,
server may need to initiate additional CHARSET subnegotiations as
user switches between applications

At a minimum, the option described in this memo allows both sides
be clear as to which character set is being used. A
implementation would have the server send DO CHARSET, and the
send WILL CHARSET and CHARSET REQUEST. The server could
communicate the client's character set to applications using
means are appropriate. Such a server might refuse subsequent
REQUEST messages from the client (if it lacked the ability
communicate changed character set information to applications,
example). Another system might have a method whereby
applications could communicate to the TELNET server their
set needs and abilities, which the server would handle by
new CHARSET REQUEST negotiations as appropriate

In some cases, servers may have a large set of clients which tend
connect often (such as daily) and over a long period of time (such
years). The server administrators may strongly prefer that
servers not do character set translation (to save CPU cycles
serving very large numbers of users). To avoid manually
each copy of the user TELNET software, the administrators
prefer that the software supports translate tables. (If the
software received a translate table from the server and stored it
the table would only need to be sent once.)

5. Description of the

When the client TELNET program is able to determine the user'
character set it should offer to specify the character set by
IAC WILL CHARSET

If the server system is able to make use of this information,
replies with IAC DO CHARSET. The client TELNET is then free
request a character set in a subnegotiation at any time

Likewise, when the server is able to determine the expected
set(s) of the user's application(s), it should send IAC DO
to request that the client system specify the character set it
using. Or the server could send IAC WILL CHARSET to offer to
the character sets




Gellens Experimental [Page 8]

RFC 2066 TELNET CHARSET Option January 1997


Once a character set has been determined, the server can
perform the translation between the user and application
sets itself, or request by additional CHARSET subnegotiations
the client system do so

Once it has been established that both sides are capable of
set negotiation (that is, each side has received either a
CHARSET or a DO CHARSET message, and has also sent either a
CHARSET or a WILL CHARSET message), subnegotiations can be
at any time by whichever side has sent a WILL CHARSET message
also received a DO CHARSET message (this may be either or
sides). Once a CHARSET subnegotiation has started, it must
completed before additional CHARSET subnegotiations can be
(there must never be more than one CHARSET subnegotiation active
any given time). When a subnegotiation has completed,
subnegotiations can be started at any time

If either side violates this rule and attempts to start a
subnegotiation while one is already active, the other side
reject the new subnegotiation by sending a CHARSET REJECTED message

Receipt of a CHARSET REJECTED or TTABLE-REJECTED message
the subnegotiation, leaving the character set unchanged. Receipt
a CHARSET ACCEPTED or TTABLE-ACK message terminates
subnegotiation, with the new character set in force

In some cases, both the server and the client systems are able
perform translations and to send and receive in the character set(s
expected by the other side. In such cases, either side can
that the other use the character set it prefers. When both
simultaneously make such a request (send CHARSET REQUEST messages),
the server MUST reject the client's request by sending a
REJECTED message. The client system MUST respond to the server'
request. (See the CHARSET REQUEST description, above.)

When the client system makes the request first, and the server
able to handle the requested character set(s), but prefers that
client system instead use the server's (user application)
set, it may reject the request, and issue a CHARSET REQUEST of
own. If the client system is unable to comply with the server'
preference and issues a CHARSET REJECTED message, the server
issue a new CHARSET REQUEST message for one of the previous
sets (one of those which the client system originally requested).
The client system would obviously accept this character set

While a CHARSET subnegotiation is in progress, data SHOULD be queued
Once the CHARSET subnegotiation has terminated, the data can be
(in the correct character set).



Gellens Experimental [Page 9]

RFC 2066 TELNET CHARSET Option January 1997


Note that regardless of CHARSET negotiation, translation only
to text (not commands), and only occurs when in BINARY mode [4].
not in BINARY mode, all data is assumed to be in NVT ASCII [1].

Also note that the CHARSET option should be used with the END
RECORD option [5] for block-mode terminals in order to be clear
what character represents the end of each record

As an example of character set negotiation, consider a user on
workstation using TELNET to communicate with a server. In
example, the workstation normally uses the Cyrillic (ASCII)
set [2] but is capable of using EBCDIC-Cyrillic [2], and the
normally uses EBCDIC-Cyrillic. The server could handle the (ASCII
Cyrillic character set, but prefers that instead the client
uses the EBCDIC-Cyrillic character set. (This and the
examples do not show the full syntax of the subnegotiation messages.)


CLIENT

WILL CHARSET WILL

DO CHARSET DO

CHARSET REQUEST
EBCDIC-

CHARSET ACCEPTED EBCDIC























Gellens Experimental [Page 10]

RFC 2066 TELNET CHARSET Option January 1997


Now consider a case where the workstation can't handle EBCDIC
Cyrillic, but can accept a translate table

CLIENT

WILL CHARSET WILL

DO CHARSET DO

CHARSET REQUEST [TTABLE] 1


CHARSET TTABLE-IS 1
EBCDIC-

CHARSET TTABLE-


For another example, consider a case similar to the previous case
but now the user switches server applications in the middle of
session (denoted by ellipses), and the new application requires
different character set

CLIENT

WILL CHARSET WILL

DO CHARSET DO

CHARSET REQUEST [TTABLE] 1
Cyrillic EBCDIC-

CHARSET TTABLE-IS 1
EBCDIC-

CHARSET TTABLE-

. . . . . .


CHARSET REQUEST EBCDIC-

CHARSET ACCEPTED EBCDIC-








Gellens Experimental [Page 11]

RFC 2066 TELNET CHARSET Option January 1997


6. Security

Security issues are not discussed in this memo

7.

[1] Postel, J. and J. Reynolds, "Telnet
Specification", STD 8, RFC 854, ISI, May 1983.

[2] Reynolds, J., and J. Postel, "Assigned Numbers",
STD 2, RFC 1700, ISI, October 1994.

[3] Postel, J. and J. Reynolds, "Telnet
Specifications", STD 8, RFC 855, ISI, May 1983.

[4] Postel, J. and J. Reynolds, "Telnet
Transmission", STD 27, RFC 856, ISI, May 1983.

[5] Postel, J., "Telnet End-Of-Record Option", RFC 885,
ISI, December 1983.

[6] Postel, J., "Internet Official Protocol Standards",
STD 1, RFC 1920, IAB, March 1996.

8. Author's

Randall
Unisys
25725 Jeronimo
Mail Stop 237
Mission Viejo, CA 92691


Phone: +1.714.380.6350
Fax: +1.714.380.5912
EMail: Randy@MV.Unisys.















Gellens Experimental [Page 12]








if you see any problems within the linking, don't worry be happy,
this is version 0.1 of the Relevance System and you gotta expect some crappy subroutines sometimes,
just be content we did not write this in Java, which would have made this "bigger and better" HAHAHHA.




RFC documents can be found at I.E.T.F.



Relevance System Copyright © 2002 Spectrum WorldResearch
other technical nosh by ServerMasters Corporation
collaboration of BobX







Spectrum