Debian Codegraph @

docs/text-encoding.rst

raw
1 Text Encoding
2 =============
3
4 This page serves as concept for adding additional CopyQ command line
5 switch to print and read texts in UTF-8 (i.e. without using system
6 encoding).
7
8 Every time the bytes are read from a command (standard output or
9 arguments from client) the input is expected to be either just series of
10 bytes or text in system encoding (possibly Latin1 on Windows). But
11 texts/strings in CopyQ and in clipboard are UTF-8 formatted (except some
12 MIME types with specified encoding).
13
14 When reading system-encoded text (MIME starts with "text/") CopyQ
15 re-encodes the data from system encoding to UTF-8. That's not a problem
16 if the received data is really in system encoding. But if you send data
17 from Perl with the UTF-8 switch, CopyQ must also know that UTF-8 is used
18 instead of system encoding.
19
20 The same goes for other way. CopyQ sends texts back to client or to a
21 command in system encoding so it needs to convert these texts from
22 UTF-8.
23
24 As for the re-encoding part, Qt does nice job transforming characters
25 from UTF-8 but of course for lot of characters in UTF-8 there is no
26 alternative in Latin1 and other encodings.