# System.nav.swap() probleme with special language charactere

**URL:** <https://forum.inductiveautomation.com/t/system-nav-swap-probleme-with-special-language-charactere/79857>\
**Category:** Ignition\
**Tags:** ignition81, vision, scripting\
**Created:** [September 29, 2023, 5:25pm UTC](https://forum.inductiveautomation.com/t/system-nav-swap-probleme-with-special-language-charactere/79857 "2023-09-29T17:25:05Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![gpellicelli](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/gpellicelli/32/53466_2.png) [@gpellicelli](https://forum.inductiveautomation.com/u/gpellicelli)\
**Post date:** [September 29, 2023, 5:25pm UTC](https://forum.inductiveautomation.com/t/system-nav-swap-probleme-with-special-language-charactere/79857/1 "2023-09-29T17:25:05Z")

</div>

Hello,

Its my first time making application for Portugais and they us like "Á" and "Ó". My Window name have sometime this and when I use script function system.nav.swap() its look like I got an error:  
File "event:propertyChange", line 9, in   
ValueError: Window 611 - TRITURADOR PRIM�?RIO (PRIMARY CRUSHER)/OVERVIEW does not exist.

When I try to print str("611 - TRITURADOR PRIMÁRIO (PRIMARY CRUSHER)/OVERVIEW") this I need to put .replace("Ã","Á") for let me know the true value. But If I use this replace I still have the error but it print the path and is good.

Any solution?

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [September 29, 2023, 5:46pm UTC](https://forum.inductiveautomation.com/t/system-nav-swap-probleme-with-special-language-charactere/79857/2 "2023-09-29T17:46:15Z")

</div>

Mark your string literals with the unicode prefix `u`.  
That is,

```auto
windowPath = u"611 - TRITURADOR PRIMÁRIO (PRIMARY CRUSHER)/OVERVIEW"

```

**not**

```auto
windowPath = "611 - TRITURADOR PRIMÁRIO (PRIMARY CRUSHER)/OVERVIEW"

```

[https://docs.python.org/2/howto/unicode.html#unicode-literals-in-python-source-code](https://docs.python.org/2/howto/unicode.html#unicode-literals-in-python-source-code)

---

<div class="post-metadata">

**Author:** ![gpellicelli](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/gpellicelli/32/53466_2.png) [@gpellicelli](https://forum.inductiveautomation.com/u/gpellicelli)\
**Post date:** [September 29, 2023, 5:49pm UTC](https://forum.inductiveautomation.com/t/system-nav-swap-probleme-with-special-language-charactere/79857/3 "2023-09-29T17:49:48Z")

</div>

> [@paul-griffith](#):
>
> `u"`

It work when its hard type like that but if am reading a value into a column of dataset or something like a tags how did i put my "u" to make it unicode?

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [September 29, 2023, 5:52pm UTC](https://forum.inductiveautomation.com/t/system-nav-swap-probleme-with-special-language-charactere/79857/4 "2023-09-29T17:52:38Z")

</div>

It depends. Are you creating the dataset yourself, or is Ignition creating it for you?  
Ignition created datasets will be backed by the Java String type, which is strictly superior to Jython's str/unicode separation and should automatically return a `unicode` type for you.  
If you're building the datasets yourself, you can use the builtin `unicode()` function to convert an arbitrary object to it's _unicode_ representation, instead of `str()`.

---

<div class="post-metadata">

**Author:** ![gpellicelli](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/gpellicelli/32/53466_2.png) [@gpellicelli](https://forum.inductiveautomation.com/u/gpellicelli)\
**Post date:** [September 29, 2023, 5:57pm UTC](https://forum.inductiveautomation.com/t/system-nav-swap-probleme-with-special-language-charactere/79857/5 "2023-09-29T17:57:32Z")

</div>

Am actually making a dataset of tag with foul tagpath inside of it and some associated window that are in a tag name "SCADA\_PAGE" and after am using a power table to open the window path assiated to it and flag it in my page. This is the code I use in the gateway to build my dataset of all my tag that have "SCADA\_PAGE" associated.

```auto
	Header = ['WindowPath','Path','Tagpath']
	List = []
	Results = system.tag.browse(path = '[default]', filter = {"recursive":True, "tagId":"UdtInstance", "tagType":"AtomicTag", "name":"*SCADA_PAGE*"})
	for Result in Results.getResults():
		if "_types_" in str(Result['fullPath']):
			pass
		else:
			#print str(result['fullPath'])
			WindowPath = str(Result['value'].value)
			Tagpath = str(Result['fullPath']).replace("/HMIMEMORY/SCADA_PAGE","")
			Path = str(Result['fullPath']).replace("/HMIMEMORY/SCADA_PAGE","").replace("[default]","")
			print WindowPath
			print Tagpath
			if WindowPath == "":
				WindowPath = "Not use in any screen"
			row = List.append([WindowPath,Path,Tagpath])

			
	system.tag.writeBlocking(["[default]MISC/InstanceNavigation"], [system.dataset.toDataSet(Header,List)])

```

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [September 29, 2023, 5:59pm UTC](https://forum.inductiveautomation.com/t/system-nav-swap-probleme-with-special-language-charactere/79857/6 "2023-09-29T17:59:35Z")

</div>

Okay, so use `unicode()` instead of `str()` to turn the tag path objects into strings and you won't lose special characters.

---

<div class="post-metadata">

**Author:** ![gpellicelli](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/gpellicelli/32/53466_2.png) [@gpellicelli](https://forum.inductiveautomation.com/u/gpellicelli)\
**Post date:** [September 29, 2023, 6:01pm UTC](https://forum.inductiveautomation.com/t/system-nav-swap-probleme-with-special-language-charactere/79857/7 "2023-09-29T18:01:16Z")

</div>

> [@paul-griffith](#):
>
> unicode()

Thank you it work fine now 😃
