1. Summary
  2. Files
  3. Support
  4. Report Spam
  5. Create account
  6. Log in

Ticket #1144 (closed defect: fixed)

Opened 3 years ago

Last modified 6 months ago

Problems with Umlauts

Reported by: eiapopeia Owned by: bharat
Priority: major Milestone: 3.0 RC 2
Version: GIT HEAD Keywords: umlauts import upload special charakters
Cc: eiapopeia

Description

When importing my pictures from Gallery2 to Gallery3, the description is not well extracted from the pictures. The text stops at the first german umlaut (äöü and so on).

Edit: This also happens, when Uploading such a picture!

Example:
Gallery3: http://rgal2.rz.htw-dresden.de/gallery3/index.php/Aktuelles/100415_Server-Z146B/10-0594 (the description is too short)
Gallery2: http://rgal2.rz.htw-dresden.de/gallery2/show/Aktuelles/100415_Server-Z146B/10-0594.jpg.html (shows the correct IPTC-Description)

As you can see in the gallery3-Example in the sidebar, the correct data is in the picture (and shown by the IPTC-Module). The data in the Database is also the false/short one.

Maybe a defect when importing the IPTC data (wrong Encoding)?

As far as I know, the IPTC-data is added with Adobe Lightroom 2.x and Windows XP.

Attachments

10-0799small.jpg (96.9 KB) - added by eiapopeia 3 years ago.
A picture with umlauts not working after import, upload, etc.

Change History

Changed 3 years ago by tnalmdal

  • milestone changed from 3.0 RC 2 to 3.1

Changed 3 years ago by bharat

  • owner set to bharat
  • status changed from new to assigned
  • milestone changed from 3.1 to 3.0 RC 2

Changed 3 years ago by bharat

  • status changed from assigned to closed
  • resolution set to fixed

I can't reproduce this anymore. I suspect it was fixed with some of our G2 Import changes. If you can reproduce this with the latest code, please reopen the bug.

Changed 3 years ago by eiapopeia

A picture with umlauts not working after import, upload, etc.

Changed 3 years ago by eiapopeia

  • cc eiapopeia added
  • keywords umlauts import upload special charakters added
  • status changed from closed to reopened
  • resolution fixed deleted
  • version changed from 3.0 RC 1 to GIT HEAD

I think, it is not only the import-form-g2-tool, but also the other upload-possibilities.

With the attached photo and todays git-code i can reproduce that the umlauts are not displayed. The description stops after the first one.

Changed 3 years ago by eiapopeia

Additional Information: When using the IPTC-Module and choosing to get the image description from the IPTC description it works fine. But as that module is not a standard, this is not a real solution.

Changed 3 years ago by bharat

  • status changed from reopened to closed
  • resolution set to fixed

Your photo makes me hungry :-)

I've figured out at least part of what's going on here. We call mb_detect_encoding() on the IPTC values, and for some reason mb_detect_encoding("Frühstück") is claiming that it's already UTF8, so we don't encode it -- but it turns out that it's not actually proper UTF-8 so when we store it in the database it gets truncated and everything goes sideways.

I'm pretty sure that we're using mb_detect_encoding() because we need to (I introduced this in 13f8a0dd7baf07ebddc72c1764b5ab13f3c9f42c back in May of 2009) so that we would encode non UTF8 code properly. utf8_encode() is not idempotent acdording to a comment here http://stackoverflow.com/questions/1523460/ensuring-valid-utf-8-in-php/1523471#1523471 so we can't just blindly call it.

So somehow we have to properly detect the encoding. Looks like there's a known bug in PHP about this:

http://bugs.php.net/bug.php?id=48210

I pushed a fix in f75ce45b6b6b848840d9a1688ca382a49de4f338

Changed 3 years ago by eiapopeia

That solves the problem. Thank you for your fast work!

Changed 6 months ago by dentizm

  • status changed from closed to reopened
  • resolution fixed deleted

This is a great inspiring article.I am pretty much pleased with your good work.mantolama,
dış cephe mantolama,mantolama malzemeleri,yalıtım,ısı yalıtımı,çatı,
çatı tadilatı,izolasyon,mantolama fiyatları,ısı yalıtım malzemeleri, You put really very helpful information. best regards.

Changed 6 months ago by bharat

  • status changed from reopened to closed
  • resolution set to fixed
Note: See TracTickets for help on using tickets.