mirror of
https://github.com/SuiteCRM/SuiteCRM.git
synced 2026-03-02 19:16:58 -05:00
Issue - Strange characters in PDF name, occurs when there are special characters in quote name. #4178
Labels
No labels
Area: API
Area: Campaigns
Area: Cases
Area: Clean Up
Area: Clean Up: Performance
Area: Dashlets
Area: Databases
Area: Developer Tools
Area: Elasticsearch
Area: Elasticsearch
Area: Emails
Area: Emails:Campaigns
Area: Emails:Cases
Area: Emails:Compose
Area: Emails:Config
Area: Emails:Templates
Area: Environment
Area: Installation
Area: Language
Area: Mobile
Area: Module
Area: PDFs
Area: PHP8
Area: Reports
Area: Studio
Area: Styling
Area: Upgrading
Area: Workflow
Area:Activity Stream
Area:Calls
Area:Import
Area:Projects
Area:Search
Area:Surveys
Area:Themes
Area:Users
Branch:Hotfix
Good First Issue
Hacktoberfest
Help Wanted
PR:Community Contribution
PR:Type:Enhancement
Priority:Critical
Priority:Important
Priority:Moderate
Severity: Major
Severity: Minor
Severity: Moderate
Status: Requires Code Review
Status: Requires Updates
Status: Stale
Status: Team Investigating
Status:Assessed
Status:Fix Proposed
Status:Needs Assessed
Status:Requires Automated Tests
Type: Bug
Type:Deprecated
Type:Discussion
Type:Duplicate
Type:Invalid
Type:Question
Type:Suggestion
Type:Suggestion
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/SuiteCRM-SuiteCRM#4178
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Jonatanestam on GitHub (Dec 30, 2019).
Issue
When I send email and there are special characters in quote name, the addressee get a file with strange characters in the PDF name.

Expected Behavior
No strange characters in the PDF name.
Actual Behavior
Strange characters in the PDF name.
Like: UTF-8QCotizaci=C3=B3n=5FCanal=5FChoice=2Epdf=
Possible Fix
Edit File modules/Emails/Email.php


around the line number 3055 add
setlocale(LC_ALL, "en_US.utf8"); $filename = iconv('UTF-8','ASCII//TRANSLIT',$filename); $filename = str_replace('_', '.', $filename);Steps to Reproduce
Your Environment
*SuiteCRM Version used: Version 7.11.9 Sugar Versión 6.5.25 (Build 344)
*Browser name and version: Firefox, Chrome, Opera.
*Environment name and version: PHP v7.2.19
*Operating System and version: CentOS Linux release 7.6.1810.2.el7.centos.x86_64GNU/Linux
*Linux Kernel: 3.10.0-957.12.1.el7.x86_64
*CPU: Intel® Core™ i7 CPU 870 @ 2.93GHz
*RAM: MemTotal: 16163660 kB
@Mausino commented on GitHub (Dec 30, 2019):
@Jonatanestam should you create the pull request?
@pgorod commented on GitHub (Jan 10, 2020):
An easy way to start a PR from the right branch, and with an up-to-date branch, is this (everything from GitHub web site, which is very convenient, but only for very simple PR's that touch only a file or two):
On GitHub, click "Code" tab and Navigate to the correct branch (

hotfix-7.10.x). You can find the branch navigator on the left, above the file list:Now navigate the directories to get to the file you want to change.
Click the edit button (with a pencil icon). GitHub will fork the repo to your own area, if it's not forked already; and it will start a new branch from a completely up-to-date
hotfix-7.10.xbranch, which is what we want.Make your changes in the editor. When you save, it creates a commit in the new branch (called
patch-1for example) in your forked repo.It will then offer to start a PR from there into SalesAgility/SuiteCRM.
The best thing is that, if you later need to change something, all you need to do is add more commits or edit more files in your repo, in that patch branch, and the PR will be updated automatically to include all that.
I hope this helps.
@pgorod commented on GitHub (Jan 11, 2020):
A question - is that
setlocalereally necessary? That affects the entire PHP process, not just the current thread. I wonder if it could have nasty side-effects. These things are very hard to test appropriately since there are so many different language set ups out there...If this code worked without that command (which it should, although the
iconvdocumentation does mention some quirky behaviours related to locales), it would be much less risky.If it is necessary to make the code work, then a solution like this one could be better: save the current setting, change it temporarily just for the
iconvcall, then put it back the way it was.@pgorod commented on GitHub (Mar 5, 2020):
@khan01 did you see my comment above?