Output Unicode Text from collection of unicode values

Apr 18, 2013 at 8:44pm

Output Unicode Text from collection of unicode values

I would like to read through a collection of values and have them output the specified standard unicode character. Does anyone know of a simple and efficient way to go about this?

Thanks for the help,

Apr 18, 2013 at 10:26pm

Please restate your question with a lot more detail.

Apr 19, 2013 at 3:41am

Well, essentially I have a set of unicode values that reference symbols, and I’d like to find a way of triggering the symbols on output.

Say I want to output the symbol ⊇ who’s technical information is:
Unicode: U+2287, UTF-8: E2 8A 87

I need to find a way of calling “U+2287″ and having it output the appropriate unicode symbol. Is there a way to access the alphabet Max uses to output characters?

I’ve thought about storing the symbols specifically in a coll or dictionary and triggering output in common ways, but this will not work my purposes, as I need to output more complex symbols that can only be created by successive unicode commands. For example:

≫̏ is a combination of U+226B followed by U+030F.

If I put the two symbols inside of a coll or dict, the successive output looks like: ≫ ̏

Apr 19, 2013 at 1:52pm

I don’t yet know what version of Max you are using nor what OS/platform. These can make substantial differences as unicode support on Max/OSx is better then Max/Windows. Also is how/where you will use or display this character. There are different abilities in mgraphics, the max window, jit.gl.text2d, 3d, etc.

Try using the (itoa) object sending in your integer value and see if you get the output you want. And continue using the like method to test it feeding into the place that you want to view the character.

Apr 19, 2013 at 2:33pm

Max uses UTF-8 encoding for its text and the itoa object works fine for multibyte UTF-8 characters:

– Pasted Max Patch, click to expand. –

Best, Jeremy

Apr 19, 2013 at 6:45pm

Thanks to you both, I’ll get to work with this.

Apr 24, 2013 at 7:01pm

Jeremy, are you expecting your patch to work on Windows? My experience is that Windows unicode support is lesser than on Macintosh. For example, the patch you posted above fails to display any of the three unicode characters from your messagebox. Instead, the resulting message box on Windows shows a square for them all.

Apr 24, 2013 at 7:25pm

Do you have a Unicode-compatible font on Windows? My vanilla Win7-x64 with Arial displays 2 of the 3 glyphs (not the one in the middle, though).

In any case, this is with 99% certainty a font issue, rather than an OS or Max issue. I’ll see if I can’t find a font which includes the middle glyph and get back.

Apr 24, 2013 at 7:33pm

Here, the Tibetan Machine Unicode font supports all three of the glyphs in my patch: http://www.aerifal.cx/~dalias/bodyig/fonts/



You must be logged in to reply to this topic.