Math symbols in title

Started by Sebbe, August 18, 2023, 10:42:59 AM

Previous topic - Next topic

Sebbe

I can't seem to get a few of the common math symbols to show upp properly when setting image titles.

Specifically: ≤ ≠ ≥

I have tried a few things like
exiftool.exe -charset utf8 -Title="å ä ö ≤ ≠ ≥" -overwrite_original_in_place "filename"This give me: ? ? ? = ? =
exiftool.exe -charset latin -Title="≤ ≠ ≥" -overwrite_original_in_place "filename"And this: å ä ö = ? =

UTF-8 seems to not take å, ä, ö, either which i will need.

I saw another post on here and they talked about the console language being wrong, so I also tried changing that to UTF8 with [Console]::OutputEncoding = [System.Text.Encoding]::UTF8 in powershell before executing the above commands

This resultet in
QuoteEncoding                 FormatProvider NewLine
--------                 -------------- -------
System.Text.UTF8Encoding sv-SE          ...   

But no change in result.

StarGeek

My standard copy/paste

See FAQ #18.

Windows CMD is has a lot of problems when it comes to non-ASCII characters.  The options in FAQ 18 may help.

In my case, those options never did work, but this StackOverflow answer fixed the problem for me.  Unfortunately, it also has the side effect of changing the fonts of some older programs and causing problems with their GUIs. .  If you use that option, you'll have to test it and see if the problems are acceptable.

Another alternative is to encode the problematic characters as HTML entities and use the -E (-escapeHTML) option.


Using the -E, you could use
exiftool -E -Title="Å Ä Ö ≤ ≠ ≥" /path/to/files/

Example output, but note I have the option in the Stackoverflow link turned on, so they display properly.
C:\>exiftool -P -overwrite_original -E -Title="Å Ä Ö ≤ ≠ ≥" y:\!temp\Test4.jpg
    1 image files updated

C:\>exiftool -G1 -a -s -title y:\!temp\Test4.jpg
[XMP-dc]        Title                           : Å Ä Ö ≤ ≠ ≥

I use a short AutoIt3 script that will grab text from the clipboard, convert special characters into HTML entities, and put it back on the clipboard.  You can find it in this post.

I run it by clicking on its icon on the desktop, but I probably should edit it to allow use as a hotkey.
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

Sebbe

Thank you!

Ended upp using a simple powershell script to rename my titles since I already had them in text form.

$HTMLbildtitel = $bildtitel -replace 'å', 'å'

$HTMLbildtitel = $HTMLbildtitel -replace 'ä', 'ä'

$HTMLbildtitel = $HTMLbildtitel -replace 'ö', 'ö'

etc etc...  :D