# UTF-8 special characters "ñ" from Transform Script

**URL:** <https://forum.inductiveautomation.com/t/utf-8-special-characters-n-from-transform-script/91004>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [May 28, 2024, 11:29am UTC](https://forum.inductiveautomation.com/t/utf-8-special-characters-n-from-transform-script/91004 "2024-05-28T11:29:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alejandro\_Alaco](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/alejandro_alaco/32/59849_2.png) [@Alejandro\_Alaco](https://forum.inductiveautomation.com/u/Alejandro_Alaco)\
**Post date:** [May 28, 2024, 11:29am UTC](https://forum.inductiveautomation.com/t/utf-8-special-characters-n-from-transform-script/91004/1 "2024-05-28T11:29:05Z")

</div>

Hi!

I aplied a transform script to a table to subsitute header values for others with special uTF-8 characters,

```python
def transform(self, value, quality, timestamp):
	
	new_headers = [
	    "Equipos de PCI",
	    "Instalacion electrica",
	    "Señalización PCI", 
	    "Iluminación emergencia", 
	    "Salidas y vías evac.",  
	    "Señalización evacuación y",  
	    "Señalización riesgo elect.",  
	    "Caída de personas mismo nivel",  
	    "Escalas fijas",
	    "Escaleras portátiles de mano", 
	    "Iluminación PVD",  
	    "Iluminación resto (no emerg.)",  
	    "Climatiz. (Temp.)",
	    "Climatiz. (Hr)",
	    "Climatiz. (CO2)",
	    "Caída de objetos desprendidos",  
	    "Atropellos",
	    "Tránsito por cubierta",  
	    "Otros riesgos detallar)"
	]
	
	
	def transform_dataset(dataset):
	   
	    py_data = system.dataset.toPyDataSet(dataset)
	    
	
	    new_data = []
	    
	
	    for row in py_data:
	        new_row = list(row)
	        new_data.append(new_row)
	    
	   
	    original_headers = list(py_data.getColumnNames())
	    modified_headers = original_headers[:2] + new_headers[:len(original_headers)-2]
	    
	
	    return system.dataset.toDataSet(modified_headers, new_data)
	
	
	transformed_data = transform_dataset(value)
	

	return transformed_data

```

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/e/4/e46272eb7415f2768039a51f349d7e6409d8a5d3.png)

But the special characters as "ñ" are not showing well. Just happens with scripts because with labels wouldn´t happen.

Wonder if there is a solution.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [May 28, 2024, 12:10pm UTC](https://forum.inductiveautomation.com/t/utf-8-special-characters-n-from-transform-script/91004/2 "2024-05-28T12:10:51Z")

</div>

You have used non-ASCII characters in jython string constants that do not support them. Use unicode string constants instead, using the `u"Mañana"` syntax. That lower-cause `u` before the first quote tells jython to handle the unicode characters correctly.

[https://docs.python.org/2.7/reference/lexical\_analysis.html#strings](https://docs.python.org/2.7/reference/lexical_analysis.html#strings)

---

<div class="post-metadata">

**Author:** ![Alejandro\_Alaco](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/alejandro_alaco/32/59849_2.png) [@Alejandro\_Alaco](https://forum.inductiveautomation.com/u/Alejandro_Alaco)\
**Post date:** [May 28, 2024, 12:21pm UTC](https://forum.inductiveautomation.com/t/utf-8-special-characters-n-from-transform-script/91004/3 "2024-05-28T12:21:42Z")

</div>

> [@pturmel](#):
>
> u

Thanks a lot pturmel, works great!

```python

	new_headers = [
	    u"Equipos de PCI",
	    u"Instalacion electrica",
	    u"Señalización PCI", 
	    u"Iluminación emergencia", 
	    u"Salidas y vías evac.",  
	    u"Señalización evacuación y",  
	    u"Señalización riesgo elect.",  
	    u"Caída de personas mismo nivel",  
	    u"Escalas fijas",
	    u"Escaleras portátiles de mano", 
	    u"Iluminación PVD",  
	    u"Iluminación resto (no emerg.)",  
	    u"Climatiz. (Temp.)",
	    u"Climatiz. (Hr)",
	    u"Climatiz. (CO2)",
	    u"Caída de objetos desprendidos",  
	    u"Atropellos",
	    u"Tránsito por cubierta",  
	    u"Otros riesgos detallar)"
	]

```

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/9/2/9230a5c0dc98e66dd081a7d0b7aca1b4e9b802d1.png)
