# utf8

**URL:** <https://rubytalk.org/t/utf8/75564>\
**Category:** ruby-talk\
**Created:** [3 September 2021 16:44 UTC](https://rubytalk.org/t/utf8/75564 "2021-09-03T16:44:23Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Die\_Optimisten](https://avatars.discourse-cdn.com/v4/letter/d/f04885/32.png) [@Die\_Optimisten](https://rubytalk.org/u/Die_Optimisten)\
**Post date:** [3 September 2021 16:44 UTC](https://rubytalk.org/t/utf8/75564/1 "2021-09-03T16:44:23Z")

</div>

Hi

How can I transform the number to the character?

'ß' -\> 223 -\> 223 .chr does not work

how an I convert the two byte-numbers [195, 159] to the utf8-number ?  
(or can this only be done by a lookup-table?)

thank you

Opti

---

<div class="post-metadata">

**Author:** ![Fernando](https://yyz1.discourse-cdn.com/flex029/user_avatar/rubytalk.org/fernando/32/2068_2.png) [@Fernando](https://rubytalk.org/u/Fernando)\
**Post date:** [3 September 2021 18:18 UTC](https://rubytalk.org/t/utf8/75564/2 "2021-09-03T18:18:23Z")

</div>

Hi Opti

> "%c" % 223

=\> "ß"

see docs: [Class: String (Ruby 3.0.2)](https://ruby-doc.org/core-3.0.2/String.html#method-i-25)

> **···**
>
> On Fri, Sep 3, 2021 at 6:45 PM Die Optimisten \<inform@die-optimisten.net\> wrote:
> 
> > Hi
> > 
> > How can I transform the number to the character?
> > 
> > 'ß' -\> 223 -\> 223 .chr does not work
> > 
> > how an I convert the two byte-numbers [195, 159] to the utf8-number ?  
> > (or can this only be done by a lookup-table?)
> > 
> > thank you
> > 
> > Opti
> > 
> > Unsubscribe: \<mailto:ruby-talk-request@ruby-lang.org?subject=unsubscribe\>  
> > \<[http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk&gt](http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk&gt);

---

<div class="post-metadata">

**Author:** ![Matthew\_Kerwin](https://yyz1.discourse-cdn.com/flex029/user_avatar/rubytalk.org/matthew_kerwin/32/1845_2.png) [@Matthew\_Kerwin](https://rubytalk.org/u/Matthew_Kerwin)\
**Post date:** [3 September 2021 19:34 UTC](https://rubytalk.org/t/utf8/75564/3 "2021-09-03T19:34:10Z")

</div>

Also have a look at #pack

> **[Class: Array (Ruby 3.0.0)](https://ruby-doc.org/core-3.0.0/Array.html#method-i-pack)**
>
> Class : Array - Ruby 3.0.0

> **···**
>
> On Sat, 4 Sep 2021, 02:46 Die Optimisten, \<inform@die-optimisten.net\> wrote:
> 
> > Hi
> > 
> > How can I transform the number to the character?
> > 
> > 'ß' -\> 223 -\> 223 .chr does not work
> > 
> > how an I convert the two byte-numbers [195, 159] to the utf8-number ?  
> > (or can this only be done by a lookup-table?)
> > 
> > thank you
> > 
> > Opti
> > 
> > Unsubscribe: \<mailto:ruby-talk-request@ruby-lang.org?subject=unsubscribe\>  
> > \<[http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk&gt](http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk&gt);

---

<div class="post-metadata">

**Author:** ![hmdne](https://avatars.discourse-cdn.com/v4/letter/h/7feea3/32.png) [@hmdne](https://rubytalk.org/u/hmdne)\
**Post date:** [4 September 2021 01:52 UTC](https://rubytalk.org/t/utf8/75564/4 "2021-09-04T01:52:21Z")

</div>

223.chr('utf-8')

> **···**
>
> On 9/3/21 6:44 PM, Die Optimisten wrote:
> 
> > Hi
> > 
> > How can I transform the number to the character?
> > 
> > 'ß' -\> 223 -\> 223 .chr does not work
> > 
> > how an I convert the two byte-numbers [195, 159] to the utf8-number ?  
> > (or can this only be done by a lookup-table?)
> > 
> > thank you
> > 
> > Opti
> > 
> > Unsubscribe: \<mailto:ruby-talk-request@ruby-lang.org?subject=unsubscribe\>  
> > \<[http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk&gt](http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk&gt);

---

<div class="post-metadata">

**Author:** ![Die\_Optimisten](https://avatars.discourse-cdn.com/v4/letter/d/f04885/32.png) [@Die\_Optimisten](https://rubytalk.org/u/Die_Optimisten)\
**Post date:** [4 September 2021 18:32 UTC](https://rubytalk.org/t/utf8/75564/5 "2021-09-04T18:32:22Z")

</div>

Thank you, any ideas to the two-byte numbers?

Opti

> **···**
>
> Am 03.09.21 um 21:34 schrieb Matthew Kerwin:
> 
> > Also have a look at #pack  
> > [Class: Array (Ruby 3.0.0)](https://ruby-doc.org/core-3.0.0/Array.html#method-i-pack)
> > 
> > On Sat, 4 Sep 2021, 02:46 Die Optimisten, \<inform@die-optimisten.net \> \<mailto:inform@die-optimisten.net\>\> wrote:
> > 
> > &nbsp;&nbsp;&nbsp;&nbsp;Hi
> > 
> > &nbsp;&nbsp;&nbsp;&nbsp;How can I transform the number to the character?
> > 
> > &nbsp;&nbsp;&nbsp;&nbsp;'ß' -\> 223 -\> 223 .chr does not work
> > 
> > &nbsp;&nbsp;&nbsp;&nbsp;---\> how an I convert the two byte-numbers [195, 159] to the  
> > &nbsp;&nbsp;&nbsp;&nbsp;utf8-number ?  
> > &nbsp;&nbsp;&nbsp;&nbsp;(or can this only be done by a lookup-table?)
> > 
> > &nbsp;&nbsp;&nbsp;&nbsp;thank you
> > 
> > &nbsp;&nbsp;&nbsp;&nbsp;Opt

---

<div class="post-metadata">

**Author:** ![Michel](https://avatars.discourse-cdn.com/v4/letter/m/ea666f/32.png) [@Michel](https://rubytalk.org/u/Michel)\
**Post date:** [4 September 2021 19:11 UTC](https://rubytalk.org/t/utf8/75564/6 "2021-09-04T19:11:46Z")

</div>

irb(main):001:0\> (195\*256+159).chr('utf-8')  
=\> "ì"

Is it the right answer ?

Michel.

Le 04/09/2021 Ã 20:32, Die Optimisten a Ã©critÂ :

> **···**
>
> > Thank you, any ideas to the two-byte numbers?
> > 
> > Opti
> > 
> > Am 03.09.21 um 21:34 schrieb Matthew Kerwin:
> > 
> > > Also have a look at #pack [Class: Array (Ruby 3.0.0)](https://ruby-doc.org/core-3.0.0/Array.html#method-i-pack)
> > > 
> > > On Sat, 4 Sep 2021, 02:46 Die Optimisten, \<inform@die-optimisten.net \>\> \<mailto:inform@die-optimisten.net\>\> wrote:
> > > 
> > > &nbsp;&nbsp;&nbsp;&nbsp;Hi
> > > 
> > > &nbsp;&nbsp;&nbsp;&nbsp;How can I transform the number to the character?
> > > 
> > > &nbsp;&nbsp;&nbsp;&nbsp;'Ã' -\> 223Â Â Â Â Â Â -\> 223 .chr does not work
> > > 
> > > &nbsp;&nbsp;&nbsp;&nbsp;---\> how an I convert the two byte-numbers [195, 159] to the  
> > > &nbsp;&nbsp;&nbsp;&nbsp;utf8-number ?  
> > > &nbsp;&nbsp;&nbsp;&nbsp;(or can this only be done by a lookup-table?)
> > > 
> > > &nbsp;&nbsp;&nbsp;&nbsp;thank you
> > > 
> > > &nbsp;&nbsp;&nbsp;&nbsp;Opt
> > 
> > Unsubscribe: \<mailto:ruby-talk-request@ruby-lang.org?subject=unsubscribe\>  
> > \<[http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk&gt](http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk&gt);

---

<div class="post-metadata">

**Author:** ![Michel](https://avatars.discourse-cdn.com/v4/letter/m/ea666f/32.png) [@Michel](https://rubytalk.org/u/Michel)\
**Post date:** [4 September 2021 19:29 UTC](https://rubytalk.org/t/utf8/75564/7 "2021-09-04T19:29:46Z")

</div>

it is !

irb(main):001:0\> (195\*256+159).chr('utf-8')  
=\> "ì"

&nbsp;&nbsp;ì Hangul Syllable Sseh

&nbsp;&nbsp;&nbsp;&nbsp;U+C39F

Le 04/09/2021 Ã 21:11, Michel Revesche a Ã©critÂ :

> **···**
>
> > irb(main):001:0\> (195\*256+159).chr('utf-8')  
> > =\> "ì"
> > 
> > Is it the right answer ?
> > 
> > Michel.
> > 
> > Le 04/09/2021 Ã 20:32, Die Optimisten a Ã©critÂ :
> > 
> > > Thank you, any ideas to the two-byte numbers?
> > > 
> > > Opti
> > > 
> > > Am 03.09.21 um 21:34 schrieb Matthew Kerwin:
> > > 
> > > > Also have a look at #pack [Class: Array (Ruby 3.0.0)](https://ruby-doc.org/core-3.0.0/Array.html#method-i-pack)
> > > > 
> > > > On Sat, 4 Sep 2021, 02:46 Die Optimisten, \<inform@die-optimisten.net \>\>\> \<mailto:inform@die-optimisten.net\>\> wrote:
> > > > 
> > > > &nbsp;&nbsp;&nbsp;&nbsp;Hi
> > > > 
> > > > &nbsp;&nbsp;&nbsp;&nbsp;How can I transform the number to the character?
> > > > 
> > > > &nbsp;&nbsp;&nbsp;&nbsp;'Ã' -\> 223Â Â Â Â Â Â -\> 223 .chr does not work
> > > > 
> > > > &nbsp;&nbsp;&nbsp;&nbsp;---\> how an I convert the two byte-numbers [195, 159] to the  
> > > > &nbsp;&nbsp;&nbsp;&nbsp;utf8-number ?  
> > > > &nbsp;&nbsp;&nbsp;&nbsp;(or can this only be done by a lookup-table?)
> > > > 
> > > > &nbsp;&nbsp;&nbsp;&nbsp;thank you
> > > > 
> > > > &nbsp;&nbsp;&nbsp;&nbsp;Opt
> > > 
> > > Unsubscribe:\<mailto:ruby-talk-request@ruby-lang.org?subject=unsubscribe\>  
> > > \<[http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk&gt](http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk&gt);
> > 
> > Unsubscribe: \<mailto:ruby-talk-request@ruby-lang.org?subject=unsubscribe\>  
> > \<[http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk&gt](http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk&gt);

---

<div class="post-metadata">

**Author:** ![Die\_Optimisten](https://avatars.discourse-cdn.com/v4/letter/d/f04885/32.png) [@Die\_Optimisten](https://rubytalk.org/u/Die_Optimisten)\
**Post date:** [4 September 2021 20:13 UTC](https://rubytalk.org/t/utf8/75564/8 "2021-09-04T20:13:31Z")

</div>

Hi,  
no, should be 'ß'... (223)

> **···**
>
> Am 04.09.21 um 21:29 schrieb Michel Revesche:
> 
> > it is !
> > 
> > irb(main):001:0\> (195\*256+159).chr('utf-8')  
> > =\> "쎟"
> > 
> > &nbsp;&nbsp;쎟 Hangul Syllable Sseh
> > 
> > &nbsp;&nbsp;&nbsp;&nbsp;U+C39F
> > 
> > Le 04/09/2021 à 21:11, Michel Revesche a écrit :
> > 
> > > irb(main):001:0\> (195\*256+159).chr('utf-8')  
> > > =\> "쎟"
> > > 
> > > Is it the right answer ?
> > > 
> > > Michel.
> > > 
> > > Le 04/09/2021 à 20:32, Die Optimisten a écrit :
> > > 
> > > > Thank you, any ideas to the two-byte numbers?
> > > > 
> > > > Opti
> > > > 
> > > > Am 03.09.21 um 21:34 schrieb Matthew Kerwin:
> > > > 
> > > > > Also have a look at #pack  
> > > > > [Class: Array (Ruby 3.0.0)](https://ruby-doc.org/core-3.0.0/Array.html#method-i-pack)
> > > > > 
> > > > > On Sat, 4 Sep 2021, 02:46 Die Optimisten, \>\>\>\> \<inform@die-optimisten.net \<mailto:inform@die-optimisten.net\>\> wrote:
> > > > > 
> > > > > &nbsp;&nbsp;&nbsp;&nbsp;Hi
> > > > > 
> > > > > &nbsp;&nbsp;&nbsp;&nbsp;How can I transform the number to the character?
> > > > > 
> > > > > &nbsp;&nbsp;&nbsp;&nbsp;'ß' -\> 223 -\> 223 .chr does not work
> > > > > 
> > > > > &nbsp;&nbsp;&nbsp;&nbsp;---\> how an I convert the two byte-numbers [195, 159] to the  
> > > > > &nbsp;&nbsp;&nbsp;&nbsp;utf8-number ?  
> > > > > &nbsp;&nbsp;&nbsp;&nbsp;(or can this only be done by a lookup-table?)
> > > > > 
> > > > > &nbsp;&nbsp;&nbsp;&nbsp;thank you
> > > > > 
> > > > > &nbsp;&nbsp;&nbsp;&nbsp;Opt

---

<div class="post-metadata">

**Author:** ![Matthew\_Kerwin](https://yyz1.discourse-cdn.com/flex029/user_avatar/rubytalk.org/matthew_kerwin/32/1845_2.png) [@Matthew\_Kerwin](https://rubytalk.org/u/Matthew_Kerwin)\
**Post date:** [4 September 2021 23:32 UTC](https://rubytalk.org/t/utf8/75564/9 "2021-09-04T23:32:00Z")

</div>

Indeed, UTF-8 isn't just a shift-and-add format.

I tried to hint at it earlier, but what about something like this?

> **···**
>
> ~~~  
> [195, 159].pack('C\*').force\_encoding('utf-8')  
> ~~~
> 
> You can look up what Array#pack and String#force\_encoding do.
> 
> Cheers
> 
> On Sun, Sep 5, 2021 at 6:15 AM Die Optimisten \<inform@die-optimisten.net\> wrote:
> 
> > Hi,  
> > no, should be 'ß'... (223)
> > 
> > Am 04.09.21 um 21:29 schrieb Michel Revesche:
> > 
> > it is !
> > 
> > irb(main):001:0\> (195\*256+159).chr('utf-8')  
> > =\> "쎟"  
> > 쎟 Hangul Syllable Sseh U+C39F  
> > Le 04/09/2021 à 21:11, Michel Revesche a écrit :
> > 
> > irb(main):001:0\> (195\*256+159).chr('utf-8')  
> > =\> "쎟"
> > 
> > Is it the right answer ?
> > 
> > Michel.  
> > Le 04/09/2021 à 20:32, Die Optimisten a écrit :
> > 
> > Thank you, any ideas to the two-byte numbers?
> > 
> > Opti
> > 
> > Am 03.09.21 um 21:34 schrieb Matthew Kerwin:
> > 
> > Also have a look at #pack  
> > [Class: Array (Ruby 3.0.0)](https://ruby-doc.org/core-3.0.0/Array.html#method-i-pack)
> > 
> > On Sat, 4 Sep 2021, 02:46 Die Optimisten, \<inform@die-optimisten.net\> \> wrote:
> > 
> > > Hi
> > > 
> > > How can I transform the number to the character?
> > > 
> > > 'ß' -\> 223 -\> 223 .chr does not work
> > > 
> > > ---\> how an I convert the two byte-numbers [195, 159] to the utf8-number ?  
> > > (or can this only be done by a lookup-table?)
> > > 
> > > thank you
> > > 
> > > Opt
> > 
> > Unsubscribe: \<mailto:ruby-talk-request@ruby-lang.org?subject=unsubscribe\>  
> > \<[http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk&gt](http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk&gt);
> 
> --  
> &nbsp;&nbsp;Matthew Kerwin  
> &nbsp;&nbsp;[https://matthew.kerwin.net.au/](https://matthew.kerwin.net.au/)

---

<div class="post-metadata">

**Author:** ![Michel](https://avatars.discourse-cdn.com/v4/letter/m/ea666f/32.png) [@Michel](https://rubytalk.org/u/Michel)\
**Post date:** [5 September 2021 06:53 UTC](https://rubytalk.org/t/utf8/75564/10 "2021-09-05T06:53:32Z")

</div>

[195,159] is [C3, 9F] in hexadecimal

[https://unicode-table.com/en/C39F/](https://unicode-table.com/en/C39F/)

Why it should be 'Ã' like 223 ?

Regards  
Michel

Le 05/09/2021 Ã 01:32, Matthew Kerwin a Ã©critÂ :

> **···**
>
> > Indeed, UTF-8 isn't just a shift-and-add format.
> > 
> > I tried to hint at it earlier, but what about something like this?
> > 
> > ~~~  
> > [195, 159].pack('C\*').force\_encoding('utf-8')  
> > ~~~
> > 
> > You can look up what Array#pack and String#force\_encoding do.
> > 
> > Cheers
> > 
> > On Sun, Sep 5, 2021 at 6:15 AM Die Optimisten \> \<inform@die-optimisten.net \<mailto:inform@die-optimisten.net\>\> wrote:
> > 
> > &nbsp;&nbsp;&nbsp;&nbsp;Hi,  
> > &nbsp;&nbsp;&nbsp;&nbsp;no, should be 'Ã'... (223)
> > 
> > &nbsp;&nbsp;&nbsp;&nbsp;Am 04.09.21 um 21:29 schrieb Michel Revesche:
> > 
> > > &nbsp;&nbsp;&nbsp;&nbsp;it is !
> > > 
> > > &nbsp;&nbsp;&nbsp;&nbsp;irb(main):001:0\> (195\*256+159).chr('utf-8')  
> > > &nbsp;&nbsp;&nbsp;&nbsp;=\> "ì"
> > > 
> > > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ì Hangul Syllable Sseh
> > > 
> > > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;U+C39F
> > > 
> > > &nbsp;&nbsp;&nbsp;&nbsp;Le 04/09/2021 Ã 21:11, Michel Revesche a Ã©critÂ :
> > > 
> > > > &nbsp;&nbsp;&nbsp;&nbsp;irb(main):001:0\> (195\*256+159).chr('utf-8')  
> > > > &nbsp;&nbsp;&nbsp;&nbsp;=\> "ì"
> > > > 
> > > > &nbsp;&nbsp;&nbsp;&nbsp;Is it the right answer ?
> > > > 
> > > > &nbsp;&nbsp;&nbsp;&nbsp;Michel.
> > > > 
> > > > &nbsp;&nbsp;&nbsp;&nbsp;Le 04/09/2021 Ã 20:32, Die Optimisten a Ã©critÂ :
> > > > 
> > > > > &nbsp;&nbsp;&nbsp;&nbsp;Thank you, any ideas to the two-byte numbers?
> > > > > 
> > > > > &nbsp;&nbsp;&nbsp;&nbsp;Opti
> > > > > 
> > > > > &nbsp;&nbsp;&nbsp;&nbsp;Am 03.09.21 um 21:34 schrieb Matthew Kerwin:
> > > > > 
> > > > > > &nbsp;&nbsp;&nbsp;&nbsp;Also have a look at #pack  
> > > > > > &nbsp;&nbsp;&nbsp;&nbsp;[Class: Array (Ruby 3.0.0)](https://ruby-doc.org/core-3.0.0/Array.html#method-i-pack)
> > > > > > 
> > > > > > &nbsp;&nbsp;&nbsp;&nbsp;On Sat, 4 Sep 2021, 02:46 Die Optimisten, \>\>\>\>\> \<inform@die-optimisten.net \<mailto:inform@die-optimisten.net\>\> \>\>\>\>\> wrote:
> > > > > > 
> > > > > > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Hi
> > > > > > 
> > > > > > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;How can I transform the number to the character?
> > > > > > 
> > > > > > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'Ã' -\> 223Â Â Â Â Â Â -\> 223 .chr does not work
> > > > > > 
> > > > > > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;---\> how an I convert the two byte-numbers [195, 159] to  
> > > > > > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;the utf8-number ?  
> > > > > > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(or can this only be done by a lookup-table?)
> > > > > > 
> > > > > > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;thank you
> > > > > > 
> > > > > > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Opt
> > 
> > &nbsp;&nbsp;&nbsp;&nbsp;Unsubscribe: \<mailto:ruby-talk-request@ruby-lang.org  
> > &nbsp;&nbsp;&nbsp;&nbsp;\<mailto:ruby-talk-request@ruby-lang.org\>?subject=unsubscribe\>  
> > &nbsp;&nbsp;&nbsp;&nbsp;\<[http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk&gt](http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk&gt);
> > 
> > --  
> > Â Matthew Kerwin  
> > [https://matthew.kerwin.net.au/](https://matthew.kerwin.net.au/)
> > 
> > Unsubscribe: \<mailto:ruby-talk-request@ruby-lang.org?subject=unsubscribe\>  
> > \<[http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk&gt](http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk&gt);

---

<div class="post-metadata">

**Author:** ![Matthew\_Kerwin](https://yyz1.discourse-cdn.com/flex029/user_avatar/rubytalk.org/matthew_kerwin/32/1845_2.png) [@Matthew\_Kerwin](https://rubytalk.org/u/Matthew_Kerwin)\
**Post date:** [5 September 2021 06:58 UTC](https://rubytalk.org/t/utf8/75564/11 "2021-09-05T06:58:44Z")

</div>

> **[UTF-8 | Encoding](https://en.wikipedia.org/wiki/UTF-8#Encoding)**
>
> UTF-8 encodes code points in one to four bytes, depending on the value of the code point. In the following table, the x characters are replaced by the bits of the code point:

> **···**
>
> On Sun, Sep 5, 2021 at 4:55 PM Michel Revesche \<michel.revesche@wanadoo.fr\> wrote:
> 
> > [195,159] is [C3, 9F] in hexadecimal
> > 
> > [https://unicode-table.com/en/C39F/](https://unicode-table.com/en/C39F/)  
> > Why it should be 'ß' like 223 ?
> > 
> > Regards  
> > Michel
> > 
> > Le 05/09/2021 à 01:32, Matthew Kerwin a écrit :
> > 
> > Indeed, UTF-8 isn't just a shift-and-add format.
> > 
> > I tried to hint at it earlier, but what about something like this?
> > 
> > ~~~  
> > [195, 159].pack('C\*').force\_encoding('utf-8')  
> > ~~~
> > 
> > You can look up what Array#pack and String#force\_encoding do.
> > 
> > Cheers
> > 
> > On Sun, Sep 5, 2021 at 6:15 AM Die Optimisten \<inform@die-optimisten.net\> \> wrote:
> > 
> > > Hi,  
> > > no, should be 'ß'... (223)
> > > 
> > > Am 04.09.21 um 21:29 schrieb Michel Revesche:
> > > 
> > > it is !
> > > 
> > > irb(main):001:0\> (195\*256+159).chr('utf-8')  
> > > =\> "쎟"  
> > > 쎟 Hangul Syllable Sseh U+C39F  
> > > Le 04/09/2021 à 21:11, Michel Revesche a écrit :
> > > 
> > > irb(main):001:0\> (195\*256+159).chr('utf-8')  
> > > =\> "쎟"
> > > 
> > > Is it the right answer ?
> > > 
> > > Michel.  
> > > Le 04/09/2021 à 20:32, Die Optimisten a écrit :
> > > 
> > > Thank you, any ideas to the two-byte numbers?
> > > 
> > > Opti
> > > 
> > > Am 03.09.21 um 21:34 schrieb Matthew Kerwin:
> > > 
> > > Also have a look at #pack  
> > > [Class: Array (Ruby 3.0.0)](https://ruby-doc.org/core-3.0.0/Array.html#method-i-pack)
> > > 
> > > On Sat, 4 Sep 2021, 02:46 Die Optimisten, \<inform@die-optimisten.net\> \>\> wrote:
> > > 
> > > > Hi
> > > > 
> > > > How can I transform the number to the character?
> > > > 
> > > > 'ß' -\> 223 -\> 223 .chr does not work
> > > > 
> > > > ---\> how an I convert the two byte-numbers [195, 159] to the utf8-number  
> > > > ?  
> > > > (or can this only be done by a lookup-table?)
> > > > 
> > > > thank you
> > > > 
> > > > Opt
> > > 
> > > Unsubscribe: \<mailto:ruby-talk-request@ruby-lang.org?subject=unsubscribe\>  
> > > \<[http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk&gt](http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk&gt);
> > 
> > --  
> > &nbsp;&nbsp;Matthew Kerwin  
> > &nbsp;&nbsp;[https://matthew.kerwin.net.au/](https://matthew.kerwin.net.au/)
> > 
> > Unsubscribe: \<mailto:ruby-talk-request@ruby-lang.org?subject=unsubscribe\> \<ruby-talk-request@ruby-lang.org?subject=unsubscribe\>\<[http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk&gt](http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk&gt); \<[http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk&gt](http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk&gt);
> > 
> > Unsubscribe: \<mailto:ruby-talk-request@ruby-lang.org?subject=unsubscribe\>  
> > \<[http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk&gt](http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk&gt);
> 
> --  
> &nbsp;&nbsp;Matthew Kerwin  
> &nbsp;&nbsp;[https://matthew.kerwin.net.au/](https://matthew.kerwin.net.au/)
