# Encoding issues in Workbench

**URL:** <https://speciforum.org/t/encoding-issues-in-workbench/1191>\
**Category:** Get Help\
**Created:** [May 26, 2023, 10:44am UTC](https://speciforum.org/t/encoding-issues-in-workbench/1191 "2023-05-26T10:44:51Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![fedoras](https://yyz1.discourse-cdn.com/flex029/user_avatar/speciforum.org/fedoras/32/455_2.png) [@fedoras](https://speciforum.org/u/fedoras)\
**Post date:** [May 26, 2023, 10:44am UTC](https://speciforum.org/t/encoding-issues-in-workbench/1191/1 "2023-05-26T10:44:51Z")

</div>

Isn’t Workbench supposed to take UTF-8 as is? I’ve uploaded the following UTF-8 encoded file:

[specimenAA (2).tsv](https://speciforum.org/uploads/short-url/wzyRWyuf5Ocpv1Gy2v0Mr8CmW8a.tsv) (4.0 KB)

The file itself show special characters as they are:

![image](https://canada1.discourse-cdn.com/flex029/uploads/specifysoftware/original/2X/6/64953a5491fb918f56d982642b96a27ef6363125.png)

However, as soon as it arrives in Workbench it’s turned into this:

![image](https://canada1.discourse-cdn.com/flex029/uploads/specifysoftware/original/2X/0/05eeebe5a10688d0f1fe5c0b1aaf00a3bd5f30cd.png)

What to do?

---

<div class="post-metadata">

**Author:** ![Grant](https://yyz1.discourse-cdn.com/flex029/user_avatar/speciforum.org/grant/32/4255_2.png) [@Grant](https://speciforum.org/u/Grant)\
**Post date:** [May 26, 2023, 1:44pm UTC](https://speciforum.org/t/encoding-issues-in-workbench/1191/2 "2023-05-26T13:44:48Z")

</div>

Hi @fedoras,

 ![WorkBench data set](https://canada1.discourse-cdn.com/flex029/uploads/specifysoftware/original/2X/c/cc27420cade091a26dc7a392d80c2fcd68d1fd2c.png)

After uploading this data set using Specify 7.8.11, there does not appear to be an encoding issue.

 ![WorkBench upload](https://canada1.discourse-cdn.com/flex029/uploads/specifysoftware/original/2X/8/8ba01acf3641c29c8a0132ba6c2ec1a26da85b19.png)

You can select the character encoding and delimiter when creating a new data set from an imported file. Are you on an earlier version of Specify 7 when this is happening?

---

<div class="post-metadata">

**Author:** ![fedoras](https://yyz1.discourse-cdn.com/flex029/user_avatar/speciforum.org/fedoras/32/455_2.png) [@fedoras](https://speciforum.org/u/fedoras)\
**Post date:** [June 7, 2023, 2:17pm UTC](https://speciforum.org/t/encoding-issues-in-workbench/1191/3 "2023-06-07T14:17:31Z")

</div>

Thanks. We’re currently stuck at v7.7.5, because we can’t upgrade until we migrate from RHEL7 to RHEL8 servers, which is dragging out.

---

<div class="post-metadata">

**Author:** ![fedoras](https://yyz1.discourse-cdn.com/flex029/user_avatar/speciforum.org/fedoras/32/455_2.png) [@fedoras](https://speciforum.org/u/fedoras)\
**Post date:** [June 7, 2024, 12:36pm UTC](https://speciforum.org/t/encoding-issues-in-workbench/1191/4 "2024-06-07T12:36:22Z")

</div>

We have updated to the latest version of Specify7, but the dropdownlist for specifying the encoding still does not appear. What is going on?

![image](https://canada1.discourse-cdn.com/flex029/uploads/specifysoftware/original/2X/0/0635f73c54f3f2a0d8c4af66b1495e4ec4296e59.png)

---

<div class="post-metadata">

**Author:** ![Grant](https://yyz1.discourse-cdn.com/flex029/user_avatar/speciforum.org/grant/32/4255_2.png) [@Grant](https://speciforum.org/u/Grant)\
**Post date:** [June 7, 2024, 2:16pm UTC](https://speciforum.org/t/encoding-issues-in-workbench/1191/5 "2024-06-07T14:16:31Z")

</div>

Hi @fedoras,

I am on `v7.9.5` here and uploaded the TSV file you attached at the beginning of this thread and can see the encoding options. I tried with a few other CSV files as well and am seeing the option

 ![image](https://canada1.discourse-cdn.com/flex029/uploads/specifysoftware/original/2X/f/fd67c5302c44c185341dd8a822aa2748d3b6015b.png)

Can you share the CSV file you are uploading with me? You can send it via email or private message if the contents are sensitive.

Thank you!

---

<div class="post-metadata">

**Author:** ![fedoras](https://yyz1.discourse-cdn.com/flex029/user_avatar/speciforum.org/fedoras/32/455_2.png) [@fedoras](https://speciforum.org/u/fedoras)\
**Post date:** [June 7, 2024, 2:55pm UTC](https://speciforum.org/t/encoding-issues-in-workbench/1191/6 "2024-06-07T14:55:34Z")

</div>

Hi!

This is an example file right here:

[NHMADtest 20240213.csv](https://speciforum.org/uploads/short-url/6Wh7WYivHuHDV8ZxoB4IYCAPjqA.csv) (4.5 KB)

Also, I don’t get encoding options with my original file either. I am on 7.9.5 too!

![image](https://canada1.discourse-cdn.com/flex029/uploads/specifysoftware/original/2X/3/39e3bf04b928a467f35e9de48309760bb53d1b54.png)

---

<div class="post-metadata">

**Author:** ![markp](https://yyz1.discourse-cdn.com/flex029/user_avatar/speciforum.org/markp/32/1184_2.png) [@markp](https://speciforum.org/u/markp)\
**Post date:** [June 7, 2024, 4:50pm UTC](https://speciforum.org/t/encoding-issues-in-workbench/1191/7 "2024-06-07T16:50:21Z")

</div>

Was going to comment that I could replicate @fedoras’s issue as I remember doing an upload yesterday and specifically looking for this option, however today the encoding option has appeared. As I doubt a hotfix was applied in the 4 hours since this was posted, the only other difference is that today I am on a mac and yesterday I was using a windows machine. I could perform further testing on Monday to gather more information.

---

<div class="post-metadata">

**Author:** ![fedoras](https://yyz1.discourse-cdn.com/flex029/user_avatar/speciforum.org/fedoras/32/455_2.png) [@fedoras](https://speciforum.org/u/fedoras)\
**Post date:** [June 10, 2024, 6:53am UTC](https://speciforum.org/t/encoding-issues-in-workbench/1191/8 "2024-06-10T06:53:49Z")

</div>

Thank you, Mark! Yes, indeed one other end user reported that she gets the dropdownlist when working from her Mac. There’s something going on here with this. Maybe the dropdownlist disappears when the format is autodetected? I would prefer it to be always there even so.

---

<div class="post-metadata">

**Author:** ![markp](https://yyz1.discourse-cdn.com/flex029/user_avatar/speciforum.org/markp/32/1184_2.png) [@markp](https://speciforum.org/u/markp)\
**Post date:** [June 10, 2024, 4:12pm UTC](https://speciforum.org/t/encoding-issues-in-workbench/1191/9 "2024-06-10T16:12:20Z")

</div>

Confirming my comment on Friday now that I am back on windows, encoding dropdown not present. Seems we have some evidence that the operating system may be the culprit.

---

<div class="post-metadata">

**Author:** ![jason\_m](https://avatars.discourse-cdn.com/v4/letter/j/8e8cbc/32.png) [@jason\_m](https://speciforum.org/u/jason_m)\
**Post date:** [June 11, 2024, 12:37am UTC](https://speciforum.org/t/encoding-issues-in-workbench/1191/10 "2024-06-11T00:37:57Z")

</div>

Hi everyone!

I have done a little investigating into this issue and have uncovered some interesting results and potential workarounds.

I was able to recreate the issue on Windows using Google Chrome Version 125.0.6422.142 (64-bit).  
Expectedly, I was _not_ able to recreate the issue on macOS using Google Chrome Version 125.0.6422.142 (arm64).

For delimiter-separated files, Specify 7 allows specifying the character encoding and delimiter. For excel based files, Specify 7 does not allow customizing these characteristics.  
Thus the problem is because specify is (incorrectly) inferring the file is excel based.

Specify uses the browser’s built-in File API to get the file’s MimeType and determine if the file is delimiter-separated or excel based.  
There seems to be a difference in the browser’s File API for arm and the standard 64-bit versions where the arm builds can correctly infer the MimeType while the standard 64-bit versions can not.

In all of the files provided in the following posts:

- **specimenAA (2).tsv** in [Encoding issues in Workbench](https://speciforum.org/t/encoding-issues-in-workbench/1191)
- **NHMADtest 20240213.csv** in [Encoding issues in Workbench - #6 by fedoras](https://speciforum.org/t/encoding-issues-in-workbench/1191/6)
  - I was only able to recreate on Windows when changing the file extension from `csv`

I was able to workaround this issue by ensuring the file has a `.csv` extension. If this workaround is not sufficient, what browser and version of browser are you using?

If `.csv` files (and their contents) are still not being interpreted as delimiter-separated, then the browser’s File API is likely determining the MimeType as something which Specify does not recognize.  
Assuming this is the case, you can still work around this and force Specify to recognize the file as delimiter-separated by changing the file extension to `psv`.

---

<div class="post-metadata">

**Author:** ![markp](https://yyz1.discourse-cdn.com/flex029/user_avatar/speciforum.org/markp/32/1184_2.png) [@markp](https://speciforum.org/u/markp)\
**Post date:** [June 11, 2024, 7:46pm UTC](https://speciforum.org/t/encoding-issues-in-workbench/1191/11 "2024-06-11T19:46:49Z")

</div>

Hi @jason_m,

I am not able to solve by having the csv extension using Firefox version 127.0 64-bit, Windows 10.

I am able to solve by switching to a .psv file extension, but this is slightly impractical. I have found that using the `.txt` extension also causes the encoding picker to appear, and would prefer to use that instead unless there is a specific reason why psv was chosen.

---

<div class="post-metadata">

**Author:** ![jason\_m](https://avatars.discourse-cdn.com/v4/letter/j/8e8cbc/32.png) [@jason\_m](https://speciforum.org/u/jason_m)\
**Post date:** [June 13, 2024, 7:13pm UTC](https://speciforum.org/t/encoding-issues-in-workbench/1191/12 "2024-06-13T19:13:13Z")

</div>

Hi @markp!  
I’m glad that the `.txt` file extension worked for your use case!

There was a reason as to why `.psv` was mentioned explicitly. When determining whether the data set is delimiter-separated or excel based, if Specify can not determine the file’s MimeType, it checks if the file has a `.psv` extension and if so, it always assumes the file is delimiter-separated. Otherwise if the file does not have a `.psv` extension and the Browser/Specify can not determine the MimeType, the file is determined to be excel based (which is what ultimately caused this issue).

If any are interested, the direct lines in the code base which handle the aforementioned logic I have provided below.

> <https://github.com/specify/specify7/blob/bb328a30a92eae17a13854356c481a5163e14759/specifyweb/frontend/js_src/lib/components/WbImport/helpers.ts#L43-L45>

The `.txt` extension worked in your case because the Browser and Specify recognized the MimeType of the file. This might not be the case for all Browsers.
