Steer things towards UTF-8, whilst also adding a notice that
historically there has been a lot of different encodings in use.

Signed-off-by: Pierre Ossman <oss...@cendio.se>
---

Index: rfbproto.rst
===================================================================
--- rfbproto.rst        (revision 3856)
+++ rfbproto.rst        (working copy)
@@ -201,6 +201,26 @@
 security types do not clash. Please see the RealVNC website at
 http://www.realvnc.com for details of how to contact them.
 
+String Encodings
+================
+
+Strings in RFB should in general be encoded using the UTF-8 encoding.
+This allows full unicode support, yet retains a good compatibility with
+older systems and libraries.
+
+The encoding used for strings in the protocol has historically often
+been unspecified, or has changed between versions of the protocol. As a
+result, there are a lot of implementations which use different,
+incompatible encodings. Commonly those encodings have been ISO 8859-1
+(also known as Latin-1) or Windows code pages.
+
+Clients and servers must send UTF-8 strings unless that particular part
+of the protocol mandates another encoding. They should however be
+prepared to receive invalid UTF-8 sequences at all times. Such
+sequences should be handled gracefully by stripping the invalid
+portions or trying to interpret the string using common encodings such
+as ISO 8859-1 or Windows code page 1252.
+
 Protocol Messages
 =================
 
@@ -614,7 +634,8 @@
 *name-length*   ``U8`` array        *name-string*
 =============== =================== ===================================
 
-where ``PIXEL_FORMAT`` is
+The text encoding used for *name-string* is UTF-8. ``PIXEL_FORMAT`` is
+defined as:
 
 =============== =================== ===================================
 No. of bytes    Type                Description


-- 
Pierre Ossman            OpenSource-based Thin Client Technology
System Developer         Telephone: +46-13-21 46 00
Cendio AB                Web: http://www.cendio.com

Attachment: signature.asc
Description: PGP signature

------------------------------------------------------------------------------
_______________________________________________
tigervnc-rfbproto mailing list
tigervnc-rfbproto@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tigervnc-rfbproto

Reply via email to