Getting curly quotes into Quicktime (and other) tags

Started by mazeckenrode, October 30, 2021, 10:26:51 PM

Previous topic - Next topic

mazeckenrode

Is there a way for me to use typographical (curly) quotes "" '' and/or other characters in ASCII range 128–255 in data to be written to QuickTime tags (or any other tags with same/similar restrictions and requirements)? I'm not finding anything in forums or docs about having to do anything to change encoding or character set, for Quicktime tags, anyway. (I am familiar with IPTC encoding tricks.) I do see various references to having to escape straight single or double quote marks as necessary under certain circumstances. I tried escaping the curly double quotes I wanted to use (\"quoted string within tag value to be written\"), but that resulted in actual backslashes followed by straight double quotes getting written to the tag:

\"quoted string within tag value to be written\"

Prior to attempting to escape my curly quotes, trying to write the string in question resulted in numerous errors:

ExifTool -m "-QuickTime:Comment="quoted string within tag value to be written"; Unquoted portion of tag value to be written; Source: <http://www.urlsgalore.com/path/sourceurl>" .

Error: File not found - string
Error: File not found - within
Error: File not found - tag
Error: File not found - value
Error: File not found - to
Error: File not found - be
Error: File not found - written; Unquoted portion of tag value to be written; Source: <http://www.urlsgalore.com/path/sourceurl>


Using ExifTool v12.30, Windows 10 Pro x64, standard command prompt.

If this applies to tags other than Quicktime, or if there are similar tricks and restrictions for some other tags, or if I've missed some already-available information about it, please say so. I've looked through the FAQ and searched the forums, but it's certainly possible I failed to hit upon the right combination of terms to search for.

StarGeek

The problem is probably the Windows command line. Have you tried FAQ #18?

You command works correctly for me but then I am also using the option show in this StackOverflow answer.  So with UTF-8 code page there's no problem.

Also alternatively, you can use the -E (-escapeHTML) option and convert annoying characters to html entities
exiftool -E -QuickTime:Comment=&ldquo;quoted string within tag value to be written&rdquo;" file.mp4
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

mazeckenrode

Quote from: StarGeek on October 30, 2021, 10:43:01 PM
Have you tried FAQ #18?

Yes, but any of various code pages I tried (1252 is what I commonly use whenever it's necessary for me to specify one) didn't make any difference.

Quote
I am also using the option show in this StackOverflow answer.  So with UTF-8 code page there's no problem.

That sounded promising, but for some reason when I tried it, any upper ASCII characters (128–255) in Notepad++ text appeared as squares, and any attempts to type them resulted in squares. I had a similar experience while trying to type this reply to you directly in my browser window, until I disabled the Windows UTF-8 option. You don't get any of that with it enabled?

Quote
you can use the -E (-escapeHTML) option

That worked, and I suppose it will have to do. Thanks much for pointing it out.

StarGeek

Quote from: mazeckenrode on October 31, 2021, 11:09:37 AMI had a similar experience while trying to type this reply to you directly in my browser window, until I disabled the Windows UTF-8 option. You don't get any of that with it enabled?

Weird.  I don't get that at all.  The worse problem I have is some GUIs in older programs (esp. older visual basic GUIs) don't like the change and use a bigger font which won't adjust the GUI properly.  But that only affects about 4-5 programs I use.
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

StarGeek

If you happen to have AutoIt3 installed, here's a short script I use to create strings for use with the -E option.  You copy the string you want to the clipboard, run the script, and the clipboard is updated with the new string.

#include <EncodeHtmlEntities.au3>

$sub = clipget()

_HtmlEntities_Encode($sub)
$sub = StringRegExpReplace($sub,"(\x0d\x0a|\x0d|\x0a)",'&#x0a;')
ClipPut($sub)


It requires the include file posted here.
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

mazeckenrode

Quote from: StarGeek on October 31, 2021, 11:42:32 AM
If you happen to have AutoIt3 installed, here's a short script I use to create strings for use with the -E option.

Cool, thanks. Actually, I use AutoHotkey, but maybe I can adapt your script for that.