Project

General

Profile

Bug #1021

Printing tags does not honor multi-byte label widths correctly

Added by Thomas Schmidt almost 7 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
metadata
Target version:
Start date:
06 Jan 2015
Due date:
% Done:

100%

Estimated time:
1.00 h

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

honorMultiByteChar.diff (1.58 KB) honorMultiByteChar.diff Thomas Schmidt, 06 Jan 2015 14:07

Associated revisions

Revision 3539 (diff)
Added by Robin Mills almost 7 years ago

#1021. Thank You Thomas for reporting this and the patch.

Revision 3545 (diff)
Added by Robin Mills almost 7 years ago

#1021. Rollback r3939 because it broke the build on MSVC 2005. See http://dev.exiv2.org/issues/1021 for discussion

History

#1

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
#2

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!

#3

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 compilation
I 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.

#4

Updated by Robin Mills almost 7 years ago

  • Status changed from Resolved to Assigned
#5

Updated by Robin Mills almost 7 years ago

r3545. Rollback submitted.

#6

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

#7

Updated by Robin Mills over 6 years ago

  • % Done changed from 0 to 100
#8

Updated by Andreas Huggel over 6 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF