Skip to main content

Unicode Conversion

Author: pmhqmw1@yahoo.co.uk (fischer21)

Hi all,   I am trying to find a way to take a character say the trademark character and convert it into its Unicode representation &#8482 in Uniface 9.6 $string allows me to take the unicode and convert it to the character but I want the opposite.   Regards   Peter

Unicode Conversion

Author: pmhqmw1@yahoo.co.uk (fischer21)

Hi all,   I am trying to find a way to take a character say the trademark character and convert it into its Unicode representation &#8482 in Uniface 9.6 $string allows me to take the unicode and convert it to the character but I want the opposite.   Regards   Peter

Hi Peter If there is no solution from UnifAce, one can do the following:

v_LIST=""
FOR v_CODEPOINT=1 to 65335
  putitem/id v_LIST,$string("&#%%v_CODEPOINT%%%"),v_CODEPOINT
ENDFOR

Not nice and maybe UnifAce will crash on not "valid" codepoints, but ... Laugh

Ingo


Author: istiller (i2stiller@gmx.de)

Unicode Conversion

Author: pmhqmw1@yahoo.co.uk (fischer21)

Hi all,   I am trying to find a way to take a character say the trademark character and convert it into its Unicode representation &#8482 in Uniface 9.6 $string allows me to take the unicode and convert it to the character but I want the opposite.   Regards   Peter

Hi Peter, just create a little HTML widget worker in the background with the following Javascript: Source: http://ecmanaut.blogspot.de/2006/07/encoding-decoding-utf8-in-javascript.html In that case you are doing it wrong; unescape(encodeURIComponent("€")) === "\\xE2\\x82\\xAC" and decodeURIComponent(escape("\\xE2\\x82\\xAC")) === "€" both return true, as they they are supposed to.


Author: ulrich-merkel (ulrichmerkel@web.de)