# Error Font (Vietnamese) When import to power table in ignition

**URL:** <https://forum.inductiveautomation.com/t/error-font-vietnamese-when-import-to-power-table-in-ignition/73632>\
**Category:** Ignition\
**Tags:** ignition81\
**Created:** [May 12, 2023, 3:45am UTC](https://forum.inductiveautomation.com/t/error-font-vietnamese-when-import-to-power-table-in-ignition/73632 "2023-05-12T03:45:46Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![haidang2015007](https://avatars.discourse-cdn.com/v4/letter/h/b2d939/32.png) [@haidang2015007](https://forum.inductiveautomation.com/u/haidang2015007)\
**Post date:** [May 12, 2023, 3:45am UTC](https://forum.inductiveautomation.com/t/error-font-vietnamese-when-import-to-power-table-in-ignition/73632/1 "2023-05-12T03:45:46Z")

</div>

I have an Excel file, I save as it to csv file ( CSV UTF-8).  
When i import to power table using code below:  
" import csv  
path = system.file.openFile("csv")  
csvData = csv.reader(open(path))  
header = csvData.next()  
dataset = system.dataset.toDataSet(header ,list(csvData))  
event.source.parent.getComponent('Power Table').data = dataset  
"  
I have an error with font (vietnamese) like the pictures  
Can anyone have a solution for this ?  
thanks a lot

 ![1](https://us1.discourse-cdn.com/inductiveautomation/original/3X/b/e/bebdb909f60c64514ea897d6225ab2a4e6ce9a08.png)

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [May 12, 2023, 9:44am UTC](https://forum.inductiveautomation.com/t/error-font-vietnamese-when-import-to-power-table-in-ignition/73632/2 "2023-05-12T09:44:26Z")

</div>

Can you share both the CSV and Excel files? Looks loke a unicode issue, but it would be easier to help troubleshoot with the files. 🙂

---

<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 12, 2023, 12:19pm UTC](https://forum.inductiveautomation.com/t/error-font-vietnamese-when-import-to-power-table-in-ignition/73632/3 "2023-05-12T12:19:26Z")

</div>

Because jython is python 2 and therefore its modules have horrible unicode support. It's a bit more trouble but I would use a java FileInputStream and java's parsing tools. Something like the techniques here:

> **[Reading a CSV File into an Array | Baeldung](https://www.baeldung.com/java-csv-file-array)**
>
> A.simple tutorial to reading CSV files in Java arrays.

For challenging cases, I use [java.io.StreamTokenizer](https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/io/StreamTokenizer.html). It can properly handle commas within quoted values.

---

<div class="post-metadata">

**Author:** ![haidang2015007](https://avatars.discourse-cdn.com/v4/letter/h/b2d939/32.png) [@haidang2015007](https://forum.inductiveautomation.com/u/haidang2015007)\
**Post date:** [May 15, 2023, 1:43am UTC](https://forum.inductiveautomation.com/t/error-font-vietnamese-when-import-to-power-table-in-ignition/73632/4 "2023-05-15T01:43:18Z")

</div>

[Product Plan.csv](https://forum.inductiveautomation.com/uploads/short-url/woTqFHPcN64q0VRPVVLORUuVZyu.csv) (3.1 KB)  
[Production Plan .xlsx](https://forum.inductiveautomation.com/uploads/short-url/lfSSk7wbk7KIGGAHKTCVgl3KYZu.xlsx) (15.4 KB)  
This's 2 file .xlsx and .csv

---

<div class="post-metadata">

**Author:** ![haidang2015007](https://avatars.discourse-cdn.com/v4/letter/h/b2d939/32.png) [@haidang2015007](https://forum.inductiveautomation.com/u/haidang2015007)\
**Post date:** [May 15, 2023, 1:47am UTC](https://forum.inductiveautomation.com/t/error-font-vietnamese-when-import-to-power-table-in-ignition/73632/5 "2023-05-15T01:47:56Z")

</div>

Thanks for your advice  
I will try this one

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [May 15, 2023, 10:45am UTC](https://forum.inductiveautomation.com/t/error-font-vietnamese-when-import-to-power-table-in-ignition/73632/6 "2023-05-15T10:45:02Z")

</div>

Your spreadsheet doesn't really lend itself well to creating a dataset with the way the headers are arranged. Merged cells don't exist in datasets, either.  
I recommend moving / removing items that are not related to the dataset.

[Production Plan-revised headers.xlsx](https://forum.inductiveautomation.com/uploads/short-url/lsoJSQiXIdlEl3S1MTuFJsKwkdU.xlsx) (15.2 KB)

I was then able to import directly from the excel file. using the function provided here:

> [@Copying an Excel file to a table's dataset](https://forum.inductiveautomation.com/t/copying-a-excel-file-to-a-tables-dataset/34942/13):
>
> Got my paperwork done early, so here's a sample to read from an Excel file EDIT: Reworked a bit to work with both .xls and .xlsx files EDIT: Modified to properly cast data types EDIT: Added handler for formula cell types EDIT: Added parameters to optionally specify sheet, row, and column numbers Reading back a file created from my other example: def excelToDataSet(fileName, hasHeaders = False, sheetNum = 0, firstRow = None, lastRow = None, firstCol = None, lastCol = None): import org.apac…

```python
path = system.file.openFile('xlsx')
dataset = util.excelToDataSet(path, hasHeaders = True, firstRow = 2, firstCol = 1, lastCol = 9)
event.source.parent.getComponent('Power Table').data = dataset

```

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/f/5/f5d659c5c5f5c746513eb4b43fab1a9b971deb83.png)

---

<div class="post-metadata">

**Author:** ![haidang2015007](https://avatars.discourse-cdn.com/v4/letter/h/b2d939/32.png) [@haidang2015007](https://forum.inductiveautomation.com/u/haidang2015007)\
**Post date:** [May 17, 2023, 7:08am UTC](https://forum.inductiveautomation.com/t/error-font-vietnamese-when-import-to-power-table-in-ignition/73632/7 "2023-05-17T07:08:52Z")

</div>

thanks a lots, I will try this one again  
thanks for your Supporting
