View Issue Details

IDProjectCategoryView StatusLast Update
0023645mantisbtotherpublic2017-12-04 02:17
Reporteratrol Assigned Toatrol  
PrioritynormalSeverityminorReproducibilityhave not tried
Status closedResolutionfixed 
Product Version2.8.0 
Target Version2.9.0Fixed in Version2.9.0 
Summary0023645: No preview of ANSI encoded text files that contain German Umlauts
Description

Preview (clicking + to expand) of a ANSI encoded text file that contain German Umlauts is not possible.
You get just an empty text area.

UTF-8 encoded files work, see attchached examples.

TagsNo tags attached.
Attached Files
ansi-umlaut.txt (12 bytes)   
Das ist �bel
ansi-umlaut.txt (12 bytes)   
utf8-umlaut.txt (13 bytes)   
Das ist übel
utf8-umlaut.txt (13 bytes)   

Activities

atrol

atrol

2017-11-17 03:49

developer   ~0058215

Strange, it works on https://www.mantisbt.org/bugs, but not on my installation.
Will have to check if this is caused by running different MantisBT versions or by different versions of PHP and OS.

atrol

atrol

2017-11-17 06:10

developer   ~0058217

Caused by different behavior of htmlspecialchars depending on PHP version.

Will provide a PR for it.

atrol

atrol

2017-11-17 09:06

developer   ~0058219

PR https://github.com/mantisbt/mantisbt/pull/1241

Related Changesets

MantisBT: master 2fd81a3e

2017-11-17 03:46

atrol


Details Diff
Fix preview of non UTF-8 text attachments

Functionality of function htmlspecialchars depends on PHP version [1].

The change ensures that
- UTF-8 is used in any case
- Single non UTF-8 characters are replaced in the string
instead of replacing the whole string by an empty string

[1] www.php.net/manual/en/function.htmlspecialchars.php

Fixes 0023645
Affected Issues
0023645
mod - core/print_api.php Diff File