Bug #1021
Printing tags does not honor multi-byte label widths correctly
100%
Description
Under a locale where labels contain multi-byte character the tag dump is not formatted correctly since std::setw does not handle the UTF-8 encoding of the labels.
Example:
---------------------------------
$exiv2 SDC12345.JPG
Dateiname : SDC12345.JPG
Dateigröße : 2778887 Bytes
MIME-Typ : image/jpeg
Bildgrõße : 4000 x 3000
Kamerahersteller: SAMSUNG
...
---------------------------------
I suggest a simple patch to correct this.
Files
Associated revisions
#1021. Rollback r3939 because it broke the build on MSVC 2005. See http://dev.exiv2.org/issues/1021 for discussion
History
Updated by Robin Mills almost 7 years ago
- Category changed from miscellaneous to metadata
- Status changed from New to Assigned
- Assignee set to Robin Mills
- Priority changed from Low to Normal
- Target version set to 0.25
Updated by Robin Mills almost 7 years ago
- Status changed from Assigned to Resolved
Patch submitted r3539. Thanks for report this and for the patch.
This seems like an ingenious and simple fix. Being a native English speaker, I have no feel for i18n issues. If you're happy that this has been effective, then I am happy to accept your help!
Updated by Robin Mills almost 7 years ago
Sadly, the fix broken the build on MSVC 2005.
35>C:\Program Files (x86)\Microsoft Visual Studio 8\VC\include\utility(35) : warning C4181: qualifier applied to reference type; ignored 35> ..\..\src\actions.cpp(249) : see reference to class template instantiation 'std::pair<_Ty1,_Ty2>' being compiled 35> with 35> [ 35> _Ty1=const std::string &, 35> _Ty2=unsigned int 35> ] 35>C:\Program Files (x86)\Microsoft Visual Studio 8\VC\include\utility(35) : warning C4181: qualifier applied to reference type; ignored 35>C:\Program Files (x86)\Microsoft Visual Studio 8\VC\include\utility(35) : error C2529: '_Val1' : reference to reference is illegal 35>C:\Program Files (x86)\Microsoft Visual Studio 8\VC\include\utility(35) : fatal error C1903: unable to recover from previous error(s); stopping compilationI could add #ifdef _MSC_VER ... #else .... #endif and use the previous code on MSVC. However this would result in different output from MSVC builds and potentially break our test suite. For the moment, I'm going to rollback r3539.
Updated by Robin Mills almost 7 years ago
- Status changed from Assigned to Resolved
Patch submitted r3547 with change to function signature. Thanks to Thomas for private email about this. Together we get things fixed. 1+1=3 in software. Sadly in management 1+1=-1
#1021. Thank You Thomas for reporting this and the patch.