Importing variables with values containing accents

Please post all questions and comments regarding Help & Manual 7 here.

Moderators: Alexander Halser, Tim Green

Post Reply
Technical Tom
Posts: 11
Joined: Thu Mar 24, 2022 2:40 pm

Importing variables with values containing accents

Unread post by Technical Tom »

I am producing a user guide for software. In preparation for its translation into various languages, I envisaged using variables for menu items (like Background or Check for software updates).

These variables would be imported from a .txt file, itself based on an Excel sheet concatenating a variable name and value, respecting the following syntax:
BACKGROUND=Arrière-plan
CHECK FOR SOFTWARE UPDATES=Rechercher les mises à jour logicielles


After importing the .txt file, these two variables appear in the list of text variables as:
BACKGROUND=Arrière-plan
CHECK FOR SOFTWARE UPDATES=Rechercher les mises à jour logicielles


Even if I restore the French accents one by one, I feel uneasy using this method for languages that I would not know how to correct.

Is there any way to more reliably import values with accents?
User avatar
Tim Green
Site Admin
Posts: 23154
Joined: Mon Jun 24, 2002 9:11 am
Location: Bruehl, Germany
Contact:

Re: Importing variables with values containing accents

Unread post by Tim Green »

Hi Tom,

You probably imported an ANSI-encoded text file instead of UTF-8. Use an editor that lets you check and convert the text encoding, like the free Notepad++ and that will fix it.
Regards,
Tim (EC Software Documentation & User Support)

Private support:
Please do not email or PM me with private support requests -- post to the forum directly.
Technical Tom
Posts: 11
Joined: Thu Mar 24, 2022 2:40 pm

Re: Importing variables with values containing accents

Unread post by Technical Tom »

I can confirm that by saving the file in UTF-8 format (or converting it to this format) enables accents to be correctly imported.
saijametsola
Posts: 2
Joined: Tue Jan 26, 2021 2:22 pm

Re: Importing variables with values containing accents

Unread post by saijametsola »

I have the same kind of problem. When I publish a project in Finnish as a PDF, the characters "ä" and "ö" appear correctly in the main text. However, the characters originating from a variable in an external file appear unreadable. The variable file was originally ASCII-encoded so I converted it to UTF-8 but it did not help. I even re-created the file from scratch in UTF-8 without success. What to do?
Tim Frost
Posts: 319
Joined: Mon Nov 22, 2004 11:45 pm

Re: Importing variables with values containing accents

Unread post by Tim Frost »

Does your UTF-8 file start with a byte order mark (BOM)? You might find it works with one, if not. If converting in NotePad++ both options are offered.
saijametsola
Posts: 2
Joined: Tue Jan 26, 2021 2:22 pm

Re: Importing variables with values containing accents

Unread post by saijametsola »

BOM did the trick. Thanks!
Technical Tom
Posts: 11
Joined: Thu Mar 24, 2022 2:40 pm

Re: Importing variables with values containing accents

Unread post by Technical Tom »

I can also confirm that selecting UTF-8 BOM encoding in Notepad++ ensured that the imported variables were displayed correctly.

Thanks for your help.
Post Reply