Project

General

Profile

MSVC & Unicode

Added by Arnold Wiegert about 3 years ago

From a brief look through this forum, it seems that Unicode is a problem for exiv2.
Is that correct?
I am trying to integrate exiv2 into an application created by someone else (vvvP) and am running into a number of issues, without much of a good idea (yet) as to whether they originate with the old application (supposedly compiled with CMake using exiv2 and Unicode).
Not being a CMake guy, and preferring MSVC, I can compile both the app and exiv2 under MSVC 2013, using Unicode strings and the multi-threaded debug dll (/MTd)
- just now using only the debug version.
The both compiles ( app & exiv2 lib) go well, but I am running into unresolved externals in the link step.
So, the first real question is: is exiv2 known to work with Unicode?


Replies (38)

RE: MSVC & Unicode - Added by Robin Mills about 3 years ago

You need the utility /bin/pkg-config.exe and you need /bin on your path.

The linking is done using libtool/pkg-config linux magic who reads the libexiv2.la file to figure what to link. Linux black magic. (remember the dog? He bites me as well).

You'll also need libexpat and libz, however if you've been able to compile, these are probably installed.

Here are some of my environment strings that I think you'll need to set:

510 rmills@rmillsmbp-w7:~/gnu $ export | grep PATH
declare -x PATH=".:/home/rmills/bin:/home/rmills/bin/cygwin:/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin" 
declare -x PKG_CONFIG_PATH="/usr/local/lib/pkgconfig:/usr/lib/pkgconfig" 
511 rmills@rmillsmbp-w7:~/gnu $
Thanks for persevering with this. Windows people can't understand how anybody can like Unix. Unix people are just as hostile to Windows. I like/dislike them equally!

RE: MSVC & Unicode - Added by Robin Mills about 3 years ago

You'll need to download the test suite. To save space in the tar-ball, we don't include it with the source. On the download page: http://www.exiv2.org/download.html

It says: Not included in the source distribution are test data and several test drivers. To download these directly from the repository (about 34 MB), change to your local exiv2-0.25/ directory and use the following command:

$ svn export svn://dev.exiv2.org/svn/tags/0.25/test
I can't image there's anything else now, but I have a feeling ..... you will find something else!

RE: MSVC & Unicode - Added by Arnold Wiegert about 3 years ago

As for Win vs Linux, I would favor Win by now :-)
Used to think *nix was the cat's meouw, but after trying several different *nix flavors, I reverted back to Win - partly because familiarity, partly because of MSVC
At the very least, IMNSHO, Win has in general gotten a bit more uniform (and better behaved). But, obviously that is open to contradiction. With *nix, the old adage referring to 'standards' applies. There are just way too many and all far too divergent - enough of my rant ;
)

After executing the svn command I was able to run make test and here is what I got:

.....
Running write2-test.sh ...
all testcases passed.
Running xmpparser-test.sh ...
all testcases passed.
Running conversions.sh ...
all testcases passed.
make1: Leaving directory '/cygdrive/d/pkg/c++/exiv/exiv2-0.25/test'

:-)

RE: MSVC & Unicode - Added by Robin Mills about 3 years ago

Well done. We got there in the end. Good Job! Incidentally, the documentation for building with Cygwin is here. Perhaps you can inspect that for errors/omissions: http://clanmills.com/exiv2/cygwin.shtml

I'm not too sure why we started down the Cygwin build road, however we've arrived. And you can build with with Visual Studio 2015 using msvc2005. Maybe you want to run the test suite on your Visual Studio build.

Right. I got up at 6am this morning and intended to fix the 2015/localtime.c (#1171) and Visual Studio/UNICODE_PATH (#1169). At 7pm, I read this message. The day has mostly disappeared in #1170. Tomorrow I will get #1169 and #1171 closed. And hope to return to v0.26 development later in the week.

I don't think I have a preference between Mac/Linux/Windows. My computers are Macs and host Linux and Windows Virtual Machines. My favourite C++/IDE is Visual Studio. The code/object browsing and debugging is really good.

RE: MSVC & Unicode - Added by Arnold Wiegert about 3 years ago

A big thank you, Robin.
I much appreciate your help in getting this sorted out.
The reason for all this? I seem to learn best by having working code (in my working environment or as close to it as possible) I can step through while researching how (best) to use a library which is used in a small way at present in an app I am hoping to use and possibly expand.

As the original app uses Unicode vs MS multi-byte strings etc, it was very important for me to be able to add that functionality.

Right now I have to get my bearings on just what of the metadata things I want to do with that app can be handled by exiv2 and in what way.

RE: MSVC & Unicode - Added by Alan Pater about 3 years ago

Arnold Wiegert wrote:

A big thank you, Robin.

Right now I have to get my bearings on just what of the metadata things I want to do with that app can be handled by exiv2 and in what way.

This is where I butt in with the recomendation to follow Metadata Working Group Guidelines. They are very specific on which fields are required by apps and on syncing the various historical standards.

RE: MSVC & Unicode - Added by Robin Mills about 3 years ago

I'd like to strongly support Alan. The Exiv2 project provides reliable/robust support to read/write/modify/delete metadata. However it's not a metadata policeman and does not attribute meaning to the metadata. The Metadata Working Group Guidelines provide the recommendation on the use and meaning of the metadata. To ensure workflows across applications requires:

  1. The data to be written in the correct format. Exiv2 will do that.
  2. The correct tags and data types are used. The Guidelines should be followed.

The subject we have been discussing is UNICODE_PATH which applies to using UNICODE in the image path passed to the library. The character sets using in strings in the Metadata is independent of UNICODE_PATH. There's a discussion and examples in the exiv2(.exe) man page. I have to confess, because my native language is English, to being a little lost with the use of UNICODE and other characters sets in strings. http://www.exiv2.org/manpage.html

RE: MSVC & Unicode - Added by Arnold Wiegert about 3 years ago

I can well understand your concerns about metadata. :-)
<rant>
In the past I have tried to understand how the various editors/manipulator apps for this data use and misuse the data.
I have also looked over many of the 'standards' and guidelines and tried to make sense of them. Very evidently these 'standards' and guidelines we created by committees for specific (usually commercial) purposes.

From my perspective, which is trying to use the data to record information I cannot record as simply part of a very limited filename, both the guidelines and they various ways graphics apps have applied or misapplied are very frustrating.

The blame for many ways in they have been misapplied and misused is surely with (mis)interpretation by the implementors, but a good part is also due to the fact that the standards and guidelines were written for commercial applications, while many would like to record information which is not directly or adequately covered by by the guidelines.
I understand XMP was intended to remedy this problem to some extent, but I'll have to see how it has progressed over the past year or so since i last had a good look at it. </rant>
My specific interest is to not only record general information about graphics files, but also more specialized information concerning the content, with much emphasis on genealogy.
I'll very much keep your advise in mind, though from what I know now, it looks like I would also have to put some of the 'standard' fields to uses which might not have been anticipated by the guidelines :-)

RE: MSVC & Unicode - Added by Alan Pater about 3 years ago

Arnold Wiegert wrote:
...

I understand XMP was intended to remedy this problem to some extent, but I'll have to see how it has progressed over the past year or so since i last had a good look at it. </rant>
My specific interest is to not only record general information about graphics files, but also more specialized information concerning the content, with much emphasis on genealogy.

XMP is designed to be extendable, so you can adapt an existing XML schema or create your own for specialized use. For example, that is what we have done with Darwin Core. http://www.exiv2.org/tags-xmp-dwc.html

Regarding your emphasis on genealogy, here are a couple of links that may be of interest:

https://gramps-project.org/
https://en.wikipedia.org/wiki/GEDCOM

But before getting into specialized schemas, make sure your app follows the general guidelines:

http://www.metadataworkinggroup.org/pdf/mwg_guidance.pdf

RE: MSVC & Unicode - Added by Jim Easterbrook about 3 years ago

Arnold Wiegert wrote:

The blame for many ways in they have been misapplied and misused is surely with (mis)interpretation by the implementors, but a good part is also due to the fact that the standards and guidelines were written for commercial applications, while many would like to record information which is not directly or adequately covered by by the guidelines.

My understanding is that the MWG guidelines were created, rather too late, to try and harmonise this mess of misapplied and misused standards. We can hope for better interoperability in the future.

RE: MSVC & Unicode - Added by Arnold Wiegert about 3 years ago

I'll drink to that, but won't hold my breath :-)

RE: MSVC & Unicode - Added by Alan Pater about 3 years ago

In the meantime, the MWG guidelines provide a base which can be tweaked for compatibility.

RE: MSVC & Unicode - Added by Arnold Wiegert about 3 years ago

@AlanPater - Thank you for the links.
I am using gramps and have been familiar with Gedcom for some time, but the MWG guidance document I had not come across in my earlier searches. I will be referring to it from here on.

(26-38/38)