Solved

Hyperlinks - Excel writer - Foreign characters in link


Badge +1

I have problems with foreign characters (åäö ÅÄÖ) in hyperlinks using the excel writer.

 

This works(no foreign characters in hyperlink path):

file_path = 1312-P11-47-00054.pdf

file_path.hyperlink = C:\\work\\table_extraction\\fme\\template_files\\FME_2019_04_24-14_38_13.3\\xml\\09_Administrativa foreskrifter\\1312-P11-47-00054.pdf

 

This does not work(foreign characters in hyperlink path):

file_path = 1312-P11-47-00054.pdf

file_path.hyperlink = C:\\work\\table_extraction\\fme\\template_files\\FME_2019_04_24-14_38_13.3\\xml\\09_Administrativa föreskrifter\\1312-P11-47-00054.pdf

 

In the Excel output I always get something like this when hovering the hyperlink when the foreign characters are in the path:

file:///C:\\work\\table_extraction\\fme\\template_files\\FME_2019_04_24-14_38_13.3\\zz.xlsx

 

The excel file seems to link to itself which is wrong. Its quite strange that the start of the chop off is the \\xml\\.

 

I have tried many different things with encodings etc but failed so far. Anyone have any ideas?

icon

Best answer by fmelizard 19 March 2021, 00:57

View original

10 replies

Badge +4

Would you be able to provide sample data?

Userlevel 1
Badge +10

I see the same issue, the address is changed to the address of the workbook if a special character is used.

Badge +3

Maybe you could use a (series of) StringReplacers to find the foreign characters and replace them with 'normal' characters if they do work.

Badge +2

Hi @krisvewsp. Thanks for raising this issue. Unfortunately, this is a known issue. We will inform you when it's fixed, by updating this thread.

In the meantime, I'm not sure what a good workaround would be. I imagine you probably don't want to change your file directories to only have English characters. Maybe as a temporary measure, write these links as a string attribute, to ensure the information is present on your spreadsheet, and when we have the hyperlink issue fixed, you can rename that string attribute to be <attribute>.hyperlink. (I know it's not the best solution. Maybe others have better ideas.)

Badge +1

Hi @krisvewsp. Thanks for raising this issue. Unfortunately, this is a known issue. We will inform you when it's fixed, by updating this thread.

In the meantime, I'm not sure what a good workaround would be. I imagine you probably don't want to change your file directories to only have English characters. Maybe as a temporary measure, write these links as a string attribute, to ensure the information is present on your spreadsheet, and when we have the hyperlink issue fixed, you can rename that string attribute to be <attribute>.hyperlink. (I know it's not the best solution. Maybe others have better ideas.)

Thanks for confirming this as a bug!

Yes, you are correct that I don't want to rename the local directories to only english characters since the original data is coming from a sharepoint like system. I dont really want to missguide the users by changing the path locally to something else that they are already familiar with in the their sharepoint solution.

Badge +1

Maybe you could use a (series of) StringReplacers to find the foreign characters and replace them with 'normal' characters if they do work.

Thanks for the suggestion! Even if I fixed the string to not contain the foreign characters I would also need to rename all the local folders to not have the foreign characters and that is not an option. See my comment on xiaomengatsafe post above. She has confirmed it as a known bug.

Badge +1

I see the same issue, the address is changed to the address of the workbook if a special character is used.

Yes, unfortunately that is the case. Its a confirmed bug, see xiaomengatsafe answer above.

Badge +1

Hi @krisvewsp. Thanks for raising this issue. Unfortunately, this is a known issue. We will inform you when it's fixed, by updating this thread.

In the meantime, I'm not sure what a good workaround would be. I imagine you probably don't want to change your file directories to only have English characters. Maybe as a temporary measure, write these links as a string attribute, to ensure the information is present on your spreadsheet, and when we have the hyperlink issue fixed, you can rename that string attribute to be <attribute>.hyperlink. (I know it's not the best solution. Maybe others have better ideas.)

Any progress on this issue?

@xiaomengatsafe

Badge +2

Any progress on this issue?

@xiaomengatsafe

Hi @krisvesweco. I checked in with the developer on this. Although the issue is not completely fixed to support all non-system encoding characters, we have observed improvements. So far, the remaining issues we've noticed are with double-byte characters, and the root problem could be in the 3rd party library we rely on for the Excel format.

 

All that is to say, I'd encourage you to give your scenario another try, with 2019.2. Things might work better for the characters you mentioned before.

We will definitely update this thread again when we are able to address the remaining problems.

Userlevel 4
Badge +13

Can confirm that as of build 21533 of FME 2021.1 (now in beta), this issue seems to be resolved. As @xiaomengatsafe suggested, it was an issue in the 3rd party library we use which they've now addressed and we've been able to integrate into FME. In general FME 2021.1 should address most edge case unicode type issues that had been outstanding, this being one of them.

Reply