Hey all
I'm using the 'string' method of [text2d] to display text. It appears that [text2d] uses latin1 to render the string, but the string actually contains utf-8 encoded text.
This is what I see in the Gem window:
«Itâs not my e-mails
This is what I get from the same string passed to [list tosymbol]/[symbolbox\
«It’s not my e-mails
Having quick glance at the source code of Gem, I get the impression that Gem is prepared to support UTF-8. How can I make it use UTF-8?
Thanks, Roman
Hello,
In fact, 'string ..." are numbers of unicode code, not utf8 (see text3d help file) So you need to convert utf8 to unicode. You are lucky, because there is an abstraction from IOhannes m zmölnig & Maira Sala that do the job for you, it is attached. ++
Jack
Le 18/08/2016 à 16:50, Roman Haefeli a écrit :
Hey all
I'm using the 'string' method of [text2d] to display text. It appears that [text2d] uses latin1 to render the string, but the string actually contains utf-8 encoded text.
This is what I see in the Gem window:
«Itâs not my e-mails
This is what I get from the same string passed to [list tosymbol]/[symbolbox\
«It’s not my e-mails
Having quick glance at the source code of Gem, I get the impression that Gem is prepared to support UTF-8. How can I make it use UTF-8?
Thanks, Roman
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list
On Don, 2016-08-18 at 18:32 +0200, Jack wrote:
Hello,
In fact, 'string ..." are numbers of unicode code, not utf8 (see text3d help file)
I see.
So you need to convert utf8 to unicode. You are lucky, because there is an abstraction from IOhannes m zmölnig & Maira Sala that do the job for you, it is attached.
Thanks. Exactly what I need, then.
I see the advantage of using unicode numbers instead of utf-8 bytes in that it is a bit easier to count the number of characters. It's just a bit unlucky that [binfile] outputs bytes, [list fromsymbol] outputs bytes, [list tosymbol] expects bytes. Ok, the 'string' method is probably older, but it looks like utf-8 is more common.
Roman