Trademark symbol not working

Topics: Developer Forum, User Forum
Jul 9, 2012 at 4:00 PM

Hello all, 

I am currently working on a project using PHPExcel and my goal is to pull data from a MS SQL database and dump it into an Excel 2007 spreadsheet.  I'm currently using:
PHPExcel Version: 1.7.6 

PHP Version 5.3.8

The problem I have is that the database has values that contain Superscript characters (or a TM - Trademark - symbol) in some of the fields.  When PHPExcel writes these fields, it drops the TM symbol and everything after it.

Here's the gist of my code:


//create new PHPExcel object
$objPHPExcel = new PHPExcel();
//Set Properties
//Blah Blah Blah

// Add data
$objPHPExcel-> setActiveSheetIndex(0) -> setCellValue("A" . $counter, $row['SkillKeyID']);

//Save File Blah Blah


The problem is that the $row['SkillKeyID'] data looks like this:

MagicTM Data for the spreadsheet.

When I inspect the .xls file created, the cell holds the following data:


It drops the superscript TM and all data afterwards.  Any ideas how to make this work?

Many thanks.

Jul 10, 2012 at 2:39 PM

Ensure that you convert your  $row['SkillKeyID'] to UTF-8 before writing it to the cell