user84318: I'm currently working on a project with a 4DSystems Display. Im talking to the Display over SoftwareSerial with an ESP32. As soon as I want to use a Unicode character it requires me to convert my whole String to a uint16_t. Can somebody help me I have no idea how I should go on with this?
  #include <genieArduino.h>
  void loop() {
    uint16_t tn[] = { 0x2126,0 }; // Ω
    genie.WriteStrU(0, tn);
  }

This works but how could I inset a variable into the uint16_t?

user7508: As mentioned by chrisl in a comment, your best option is to to use the
regular WriteStr() method to print variables, and use WriteStrU() to
print Unicode string constants. For example:
float R = 12.34;  // dummy resistance value.
genie.WriteStr(0, "R = ");
genie.WriteStr(0, R);
genie.WriteStrU(0, (uint16_t *) u" Ω");

should print:
R = 12.34 Ω

Note the use of the u string prefix to write UTF-16-encoded strings in
the source code.

Edit: You wrote

the WriteStr always replaces the text inside a String object instead
of adding on.

This makes things more complicated. The only option I see is to format
the whole message as UTF-16 beforehand, then send it with WriteStrU().
Here is a class that does simple UTF-16 formatting. It inherits from the
Print class, meaning you can print() to it anything you could print
to Serial. In addition, it can print UTF-16 strings:
template <size_t max_length>
class UTF16Writer : public Print {
public:
    // Convert ASCII to UTF-16.
    size_t write(uint8_t c) {
        if (length >= max_length)
            return 0;  // buffer full
        buffer[length++] = c;
        buffer[length] = 0;  // terminate string
        return 1;
    }
    // Record UTF-16 data.
    size_t print(const char16_t *s) {
        size_t chars_written = 0;
        while (*s && length < max_length) {
            buffer[length++] = *s++;
            chars_written++;
        }
        buffer[length] = 0;  // terminate string
        return chars_written;
    }
    using Print::print;
    uint16_t buffer[max_length + 1];
private:
    size_t length = 0;
};

The template parameter is the capacity of the buffer. Once you have
written the whole message as UTF-16 using this class, you can pass its
buffer member to WriteStrU(). For example:
float R = 12.34;  // dummy resistance value.
UTF16Writer<16> writer;
writer.print("R = ");
writer.print(R);
writer.print(u" Ω");
genie.WriteStrU(0, writer.buffer);

Note: Do not forget the u prefix in the Unicode string, otherwise
the bytes of the string (UTF-8 in the source) would be interpreted as
latin1 by UTF16Writer::print(const char*). A message such as "martine écrit en UTF-8" would then be displayed as “martine Ã©crit en UTF-8”.

84318: <p>I'm currently working on a project with a 4DSystems Display. Im talking to the Display over SoftwareSerial with an ESP32. As soon as I want to use a Unicode character it requires me to convert my whole String to a uint16_t. Can somebody help me I have no idea how I should go on with this?</p>
<pre><code>  #include &lt;genieArduino.h&gt;
  void loop() {
    uint16_t tn[] = { 0x2126,0 }; // Ω
    genie.WriteStrU(0, tn);
  }
</code></pre>
<p>This works but how could I inset a variable into the uint16_t?</p>
 7508: <p>As mentioned by chrisl in a comment, your best option is to to use the
regular <code>WriteStr()</code> method to print variables, and use <code>WriteStrU()</code> to
print Unicode string constants. For example:</p>
<pre class="lang-cpp prettyprint-override"><code>float R = 12.34;  // dummy resistance value.
genie.WriteStr(0, &quot;R = &quot;);
genie.WriteStr(0, R);
genie.WriteStrU(0, (uint16_t *) u&quot; Ω&quot;);
</code></pre>
<p>should print:</p>
<pre><code>R = 12.34 Ω
</code></pre>
<p>Note the use of the <code>u</code> string prefix to write UTF-16-encoded strings in
the source code.</p>
<hr />
<p><strong>Edit</strong>: You wrote</p>
<blockquote>
<p>the <code>WriteStr</code> always replaces the text inside a String object instead
of adding on.</p>
</blockquote>
<p>This makes things more complicated. The only option I see is to format
the whole message as UTF-16 beforehand, then send it with <code>WriteStrU()</code>.
Here is a class that does simple UTF-16 formatting. It inherits from the
<code>Print</code> class, meaning you can <code>print()</code> to it anything you could print
to <code>Serial</code>. In addition, it can print UTF-16 strings:</p>
<pre class="lang-cpp prettyprint-override"><code>template &lt;size_t max_length&gt;
class UTF16Writer : public Print {
public:
    // Convert ASCII to UTF-16.
    size_t write(uint8_t c) {
        if (length &gt;= max_length)
            return 0;  // buffer full
        buffer[length++] = c;
        buffer[length] = 0;  // terminate string
        return 1;
    }
    // Record UTF-16 data.
    size_t print(const char16_t *s) {
        size_t chars_written = 0;
        while (*s &amp;&amp; length &lt; max_length) {
            buffer[length++] = *s++;
            chars_written++;
        }
        buffer[length] = 0;  // terminate string
        return chars_written;
    }
    using Print::print;
    uint16_t buffer[max_length + 1];
private:
    size_t length = 0;
};
</code></pre>
<p>The template parameter is the capacity of the buffer. Once you have
written the whole message as UTF-16 using this class, you can pass its
<code>buffer</code> member to <code>WriteStrU()</code>. For example:</p>
<pre class="lang-cpp prettyprint-override"><code>float R = 12.34;  // dummy resistance value.
UTF16Writer&lt;16&gt; writer;
writer.print(&quot;R = &quot;);
writer.print(R);
writer.print(u&quot; Ω&quot;);
genie.WriteStrU(0, writer.buffer);
</code></pre>
<p><strong>Note</strong>: Do not forget the <code>u</code> prefix in the Unicode string, otherwise
the bytes of the string (UTF-8 in the source) would be interpreted as
latin1 by <code>UTF16Writer::print(const char*)</code>. A message such as <code>&quot;martine écrit en UTF-8&quot;</code> would then be displayed as “martine Ã©crit en UTF-8”.</p>
