Ascii Characters in Email
-
I just set up buddypress on my site yesterday and I’m still tweaking it to fit my theme. I am able to find most of my answers in the forums – kudos to you all for providing such help!
My issue is that the name of my site is Girls Can’t WHAT? but when an email notification is sent to a user form buddypress, it shows up as Girls Can't WHAT? (in case that gets mangled when I click “send post”, the apostrophe is converted to the ascii code instead of the apostrophe.)
I tried changing it in my wp general settings to the ascii code instead of the apostrophe, but it still shows up that way. I even tried using /’ but that didn’t work either. How can I fix this?
-
Unless you can write PHP, not easily. Which email are you seeing this problem in?
I see it in all emails…friend requests, private messages…anything that send an email notification.
Please would you submit this as a bug on https://trac.buddypress.org/ please, using your username and password from this site. Thank you.
Will do.
Before I post, I have another thought. I just got a blog comment notice sent to my email and it is now also showing the ascii character, but only in the sender field (Girls Can’t WHAT? shows up properly formatted in the subject line). It used to show the sender as ‘WordPress’. Now I’m not sure if this is a buddypress issue or because I updated WordPress right before I installed buddypress. Any clues?
Not really a bug. I experienced the same issue a while ago with french translation.
Let me explain:
when translating, all strings going through php need to use ascii, like & nbsp; for a space.
the same string going normal nedd only a invisible (tabed) space.
The email messages are the exception in this handle. They have not to translate special caracters. Translators have to write them usually, not with ascci caracters.
If you use poEdit, you can rewrite the email messages in your natural language or ask the author. His name is normaly in the header of the pot file. You can also find his name on the BP i18nn trac:
https://i18n.trac.buddypress.org/browser
Oh, and to escape in emails code, you have to use anti slash, not slash as given in your explanation.
This is still an issue, I’ve seen it on a local install
I tried the anti-slash and double anti-slash…still nothing. The emails are picking up this string from the general options “blog title”. I don’t know of any other way to make it work.
I just registered a test user so I could replicate the issue and I noticed this difference in the subject lines:
[Girls Can' ;t WHAT?] Activate Your Account (intentional space left in to demonstrate the error)
[Girls Can’t WHAT?] New User Registration
The new user registration notice is correct in the subject line (the sender is still displaying wrong, although it used to just say ‘WordPress’ for the sender name.)
So is this a buddypress issue or a wordpress issue?
I have the exact same problem.
My buddypress group is called Writers’ Bloc
However the email post notifications always get delivered as
Writers' ; Bloc (ampersand hash zero three nine semicolon instead of apostrophe, I added a space so you can see the problem)I have not figured out a way to have it appear as an apostrophe in the emails. Is this a buddypress bug? or post notifications?
I know PHP so if someone can direct me to the right file I can probably fix it myself…
I’m experiencing a related issue with ASCII in emails:
http://www.screencast.com/t/8D3l3vuqqrAny thoughts? Is this related to the awful curly quotes that come default?
I too am having this issue with topic notification email…
What’s your biggest challenge?
becomes
What' ;s your biggest challenge?
I mostly see this in the subject line, but sometimes in the body, and not just with an apostrophe but double-quotes, etc.
Hi, I’m also still having this issue… My site name Texas A&M etc… becomes Texas A&M etc.. in buddypress emails. I’m running BP 1.7 beta 1 and latest WP.
When untranslated, obviously, an apostrophe is the same as a single quote, and primes are either a double quote or a single quote. And, when texturized, an apostrophe uses the same HTML entity (& 8 217 ; – without space) as a closing single quote. You may have a desire to translate these, or there may be no need to. That’s fine.
source: https://make.wordpress.org/polyglots/important-changes-for-wordpress-3-4/
Translation of email message must be writen normally.
in a php string, what’s new should be written what & # 39; s new (without space) (iso latin-1)
the ampersanded company name in the po file should be: A & a m p; M(without space)in a email message (and only in email message), you write what’s new or A&M
BP use UTF8 charset by default and XML transitionnal encoding
That’ said, some mail reader’s convert html entities into what?new or what â € ™ s. In such case you have to check your mail software or browser settings.
http://en.wikipedia.org/wiki/Character_encodings_in_HTML
http://www.w3.org/TR/REC-html40/sgml/entities.html
http://www.utexas.edu/learn/html/spchar.html
http://en.wikipedia.org/wiki/Miscellaneous_Symbolschouf1 – thanks for the info. I added a translation as you suggested (with &), but still have no luck. These emails are being generated by the notification area of buddy press 1.7 beta 1. The name has the & but the subject does not – i.e.:
from email@email.com
subject name & name comes through just fineSo, it’s only happening in the from name, and is not consistent – I assume it’s using the same field as site name?
Thanks, Jon
Let me resume.
Notification email contain malformed strings.
The affected part is the subject Right ?
FROM: bla@blabla.bla – your explanation about this field is not clear, because “FROM” contain a mail address by default, so i don’t understand what’s wrong for you.SUBJECT: bla bla Courtesy, something & thing. Where & (coming through the site name shortcode used in the email form is not correctly outputed. Right ?
I would try to go into the site settings where the site name is defined and change the original A&T by the ampersanded html: A & amp ; T (without space)
As BP 1.7 stable is now on hand, install it first. Maybe this will solve the problem. If not, you’re welcome back !
Or better if this persist, open a ticket on Trac.
Ok – thanks – I didn’t realize 1.7 was official – I will update. The From name is where I’m having the problem, for example A&P Site – just the display name on the email – nowhere else am I have the problem.
Anyway, thanks – I will update and see if this resolves it-
sorry, I can never post any code here not sure why..
have you tried to change your site title with the html trick ?
Chouf1, thanks for following me on this topic… Not sure what I’m doing wrong here.. I updated to BP 1.7 stable (I’m also running latest WP), did some tests with notifications and am still get the & amp ; in just the display name of the email (subject is still fine). I reversed the translations that I did in the language files for site name to add & amp ; to no avail… One thing I didn’t try is add a translation to just Name & Name – I’ll try that now.
Regarding your question, I’ve tried to add & amp ; to the site title in general settings and it’s always converted to just &. In the source, it’s output as & amp ;. Not sure how to proceed to fix.. I’ll try the above-
Man, this is a real thorn in my side here.. I cannot get this to work – tried translating the site name to both & and & amp ; plus, I’m now running the latest BP and WP – anything else I can try? Seems like a bug..
Thanks, Jon
dudes, I feel like a dummy… this resolved my issue:
`
add_filter(‘wp_mail_from’, ‘new_mail_from’);
add_filter(‘wp_mail_from_name’, ‘new_mail_from_name’);function new_mail_from($old) {
return ’email@youraddresshere.com’;
}
function new_mail_from_name($old) {
return ‘Name and Stuff & Stuff’;
}
`p.s. thanks for your help chouf1
- The topic ‘Ascii Characters in Email’ is closed to new replies.