Charset in text output file

Started by Breddam, November 27, 2019, 05:18:10 PM

Previous topic - Next topic

Breddam

Hi,

I'm using MapInfo/Mapbasic which only can write and understand ANSI- not UTF8.
I'm from Denmark and we have some special characters: ÆØÅæøå

From MapInfo/Mapbasic I send this user induced command: (i.e.)

"exiftool.exe" -c "%%.6f" -Filename -DateTimeOriginal  "I:\NATUR & MILJ\KYSTbeskyttelse\Billeder\Storm_20190102_alfrida" > "(...)\exifout.txt" -charset Filename=cp1252

This produces a nice UTF8-file:
snip
======== I:/NATUR & MILJØ/KYSTbeskyttelse/Billeder/Storm_20190102_alfrida/Rødvig_IMG_1928.JPG
File Name                       : Rødvig_IMG_1928.JPG

Imported to MapInfo this info doesn't look nice:
I:\NATUR & MILJØ\KYSTbeskyttelse\Billeder\Storm_20190102_alfrida\R+©dvig_IMG_1928.JPG
R+©dvig_IMG_1928.JPG


I also in addition tried using
-charset exiftool=cp1252
which produces an ANSI file with the same odd characters. (And a lot other trial-and-error  :-X)

I myself _could_ use UltraEdit to convert the UTF8-file but this is not an option for my users who want to have the feature to store some images from their I- or Android phones and get them georeferenced from MapInfo in a batch process. (And I'd rather not tell them to omit æøå in the file names)

What have I missed in the documentation? It seems like ExifTool is able to do the conversion - but I'm not...

Does anybody have heads up?

TIA
Søren Breddam

Phil Harvey

Hi Søren,

I have read your post a number of times and still don't understand what you are asking.  Is this an ExifTool question?

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Breddam

Hi Phil,

I'm trying to figure out how to set the codepage to ANSI in the output file 'exifout.txt'. (Now I've found out that it has to be Codepage850)
When I process the text-file i MapInfo I cannot use UTF.

I use ExifTool to extract coordinates and file names so that I can georeference all images in a folder. (I.e. Push button in MapInfo->Select Folder->A table containing all images appears in Mapinfo with their locations plotted and with a hotlink to the actual file)
It works fine except for images with special characters.

Regards Søren

Phil Harvey

Try this:

exiftool -charset cp850 -charset filename=cp1252 ...

-charset filename=cp1252 is the character set you use when specifying the filename.

-charset cp850 is the character set used for the output tag values.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Breddam

Thanks Phil,

This works flawlessly :-D
Thanks a lot!

In the meantime I've prematurely launched the application to two users with a quickfix in form of CONVERTCP - a neat little program that addresses the 'nordic problem' with æ ø/ö å.
I can avoid that now.

If anybody wants the code to the Mapbasic app, then I'll share it.

Regards Søren