How To Concatenate Superscript ASCII Characters in a Script

Description

The script data source window does not support superscript ASCII characters. This article will outline how to get around this limitation and concatenate high ASCII characters, such as ™ © ®, in a script.

How to Concatenate Superscript ASCII Characters in a Script

  1. Set up a scripting field and an input field on a new label.

  2. Create an output field (must use language wizard/field override UTF-8 or UTF-16).
  3. Modify the example below using the names of the fields on your label.
  4. Copy the modified script into the scripting field data source window.

  5. You can change the character by using the Character Map tool to get the U+xxxx code.
Copy
<pre class="syntaxhighlighter-pre" xml:space="preserve">//Begin
 var coName = String(label.fields.field.(@name == 'CoName').@data); 
 //concat "TM" symbol \u value found in character map
 coName = coName + "\u2122"; 
 label.fields.field.(@name == 'CoName_TM').@data = coName; </pre>

 If the Company Name (coName) in the example above was LOFTWARE the result would be:

LOFTWARE™