<?xml version="1.0" encoding="US-ASCII"?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd" [
    <!ENTITY rfc2119 PUBLIC ''
        'http://xml.resource.org/public/rfc/bibxml/reference.RFC.2119.xml'>
    <!ENTITY utf8 PUBLIC ''
        'http://xml.resource.org/public/rfc/bibxml/reference.RFC.3629.xml'>
    <!ENTITY sshconn PUBLIC ''
        'http://xml.resource.org/public/rfc/bibxml/reference.RFC.4254.xml'>
]>
<?xml-stylesheet type='text/xsl' href='rfc7749.xslt' ?>
<?rfc toc="yes"?>
<?rfc tocompact="yes"?>
<?rfc tocdepth="6"?>
<?rfc symrefs="yes"?>
<?rfc sortrefs="yes"?>
<?rfc compact="yes"?>
<?rfc subcompact="no"?>

<rfc number="8160" category="std" submissionType="IETF" consensus="yes"
  ipr="trust200902">

  <front>
    <title abbrev="IUTF8 Terminal Mode in SSH">IUTF8 Terminal Mode in Secure Shell (SSH)</title>
    <author initials="S.G." surname="Tatham" fullname="Simon Tatham">
      <organization abbrev="PuTTY">PuTTY</organization>
      <address>
        <email>anakin@pobox.com</email>
      </address>
    </author>
    <author initials="D.A." surname="Tucker" fullname="Darren Tucker">
      <organization abbrev="OpenSSH">OpenSSH</organization>
      <address>
        <email>dtucker@openssh.com</email>
      </address>
    </author>
    <date month="April" year="2017" />
    <area>Applications</area>
    <keyword>Secure Shell</keyword>
    <keyword>SSH</keyword>
    <abstract>
      <t>
        This document specifies a new opcode in the Secure Shell
        terminal modes encoding. The new opcode describes the widely
        used IUTF8 terminal mode bit, which indicates that terminal
        I/O uses UTF-8 character encoding.
      </t>
    </abstract>
  </front>
  <middle>
    <section title="Introduction">
      <t>
        The Secure Shell (SSH) connection protocol <xref
        target="RFC4254" /> provides an encoding for terminal modes,
        used in the "pty-req" channel request type.
      </t>
      <t>
        A commonly used terminal mode is IUTF8, which indicates that
        the terminal driver should assume that terminal I/O uses the
        UTF-8 character encoding <xref target="RFC3629" />. This is
        typically used by the kernel's terminal driver on the server
        to decide how many bytes of input to treat as a single logical
        character during line editing.
      </t>
      <t>
        SSH does not currently provide an encoding for IUTF8. This
        document specifies one.
      </t>
    </section>
    <section anchor="mustshouldmay" title="Conventions Used in This Document">
      <t> The key words "MUST", "MUST NOT", "REQUIRED", "SHALL",
      "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and
      "OPTIONAL" in this document are to be interpreted as described
      in <xref target="RFC2119"/>.</t>
    </section>
    <section title="New IUTF8 Opcode for Terminal Mode Encoding">
      <t>
        The opcode value 42 is defined for the IUTF8 terminal mode.
      </t>
      <t>
   As specified in Section 8 of <xref target="RFC4254"/>, all opcodes in the range 1 to
   159 have a single uint32 argument; therefore, the IUTF8 opcode is
   followed by a single uint32 argument. The value 0 indicates that the IUTF8
        mode is disabled, and the value 1 indicates that it is
        enabled.
      </t>
      <t>
        As with all other encoded terminal modes, the client SHOULD
        transmit a value for this mode if it knows about one, and the
        server MAY ignore it.
      </t>
    </section>
    <section title="IANA Considerations">
      <t>
        This document augments the list of "Pseudo-Terminal Encoded Terminal
	Modes" defined in Section 8 of <xref target="RFC4254"/>.
      </t>
      <t>
        IANA has added the following opcode to the "Pseudo-Terminal Encoded
	Terminal Modes" registry: 
      </t>
      <figure>
        <artwork>
opcode  mnemonic       description
------  --------       -----------
42      IUTF8          Terminal input and output is assumed to be
                        encoded in UTF-8.
        </artwork>
      </figure>
    </section>
    <section title="Security Considerations">
      <t>
        The security considerations of <xref target="RFC4254"/> apply.
        This additional terminal mode encoding is believed to have no
        security implications differing from the existing set of
        encoded terminal modes.
      </t>
      <t>
        Since the IUTF8 terminal mode is intended for use in
        conjunction with the UTF-8 character encoding, the security
        considerations of <xref target="RFC3629"/> also apply to
        systems in which this mode is enabled. In particular, terminal
        drivers that interpret this bit as enabling UTF&nbhy;8&nbhy;aware line-editing behavior should carefully consider how that behavior
        will treat illegal sequences, overlong encodings, and redundant
        representations of composed characters (see <xref
        target="UNICODE"/>).
      </t>
    </section>
    <section title="Acknowledgements">
      <t>
        The authors are indebted to Colin Watson for originally
        suggesting this terminal mode in 2005, and David Madore and
        Jakub Jelen for prior implementation efforts.
      </t>

    </section>
  </middle>
  <back>
    <references title="Normative References">
      &rfc2119;
      &sshconn;
      &utf8;
    </references>
    <references title="Informative References">
      <reference anchor="UNICODE"
                 target="http://www.unicode.org/versions/latest/">
        <front>
          <title>The Unicode Standard</title>
          <author>
            <organization>The Unicode Consortium</organization>
          </author>
          <date />
        </front>
      </reference>
    </references>
  </back>
</rfc>
