ZF2 Email with german umlauts in from name - zend-framework2

I get the exception "Invalid header value detected", if I use german umlauts like 'äöü' in the from name of an email.
$message->setFrom('noreply#mydomain.de', 'äöü')
Does anyone know hot to fix this?

One possible solution could be to convert the mail address to the correct writing (includes converted umlaut).
You can use icon php function for this action.

Related

Change Encoding in ModelState.ModelError

Here is my problem: I add a message to ModelError with addModelError(String.Empty,”My message”).
In my view I just call #Html.ValidationSummary().
The message is in German and the characters Ö, Ä, Ü are just shown as questionmark. How do I change that?
As I see it there are two options. One option is to write a custom validation summary helper which doesn't HTML encode the messages like described in the link that Kartikeya Khosla provided. Or, and that’s what I did, Just use the Unicode reference in the message string. The solution in Kartikeya is more elegant, but in my case it is a lot of code to change two characters. By the way here a link to look them up if anybody wants to do the same:
http://www.utf8-chartable.de/unicode-utf8-table.pl?utf8=oct&unicodeinhtml=dec&htmlent=1

UIActivityViewController Gmail share extension duplicated body

I've seen some weird thing with the gmail share extension, like the body and the subject fields are empty if you want to share a content containing a & character.
It's possible to get it working with escaping the & character with &, however this way the body in the message is duplicated (once the original, and once the escaped.
Do you guys know a workaround for this issue?
Thanks in advance!
The only workaround I've found is to remove every special characters (I was able to replace & with 'and' - it was in text, not in link)

Grails 2.3.8 Internationalization coded strings

I don't understand why some strings in my messages.properties files won't show in my gsp. More exactly, the show in term of the key name in the file not the value.
For example, this string in my messages.properties:
gtunes.store.subtitle=Your online music store and storage service!
is showing up on the gsp where I have this line of code:
<h1><g:message code='gtunes.store.subtitle'/></h1>
simply as:
gtunes.store.subtitle
My code is here.
I downloaded your app and the reason for the error is because there's no message with this key configured in messages.properties.
If you try to render a message for a key that doesn't exist, the key is displayed instead.

How to transform encoded URL to readable texts?

It's about Bangla Unicode texts, but can be a problem for any language other than Latin glyphs.
I'm a host of a Bangla blog with all its texts and categories in Bangla (I prefer not to say Bengali as because the name of the language is Bangla rather than Bengali).
So the category in Bangla "বাংলা" saying a URL like:
http://www.example.com/category/বাংলা
But whenever I copied the URL from address bar and put 'em into a chat panel or somewhere else, it changed with some strange characters, for example:
http://www.example.com/category/%E0%A6%B8%E0%A7%8D%E0%A6%A8%E0*
* it's just an example, not the exact gibberish for the word "বাংলা")
So, in many cases I got some encoded URLs like above, from where I found no trace which Unicode text they are saying. Recently I'm getting some 404 error logged by one of my plugin. From there I found a URI like:
/category/%E0%A6%B8%E0%A7%8D%E0%A6%A8%E0%A6%BE%E0%A7%9F%E0%A7%81%E0%A6%AC%E0%A6%BF%E0%A6%A6%E0%A7%8D%E0%A6%AF%E0
I used the Jetpack's Omnisearch to find out any match, but the result is empty. I can't even trace which category that is— creating such a 404.
So here comes the question:
How can I transform the encoded URL to readable glyphs?
http://www.example.com/category/বাংলা
isn't a URL; URLs can only contain ASCII characters. This is an IRI.
http://www.example.com/category/%E0%A6%AC%E0%A6%BE%E0%A6%82%E0%A6%B2%E0%A6%BE
is the URI representation of that IRI. They are otherwise equivalent. A browser may display the ‘pretty’ IRI version in the user interface, but put the URI version on the clipboard so that you can paste it into other tools that don't support IRI.
The 404 address you pasted translates to:
/category/স্নায়ুবিদ্য�
where the last character is a � because it is an invalid, truncated UTF-8 sequence. (This is probably why the request failed.) Someone may have mis-pasted a partial URI here.
If you're using javascript you can do:
decodeURIComponent(url);
This will make sure the original language is preserved.

Problems od special characters with sfWidgetFormDoctrineChoice in Symfony

I'm using sfWidgetFormDoctrineChoice to get a list of languages from a MySql database. The list is in spanish language. All languages with special characters like for ex. Árabe looks OK (it got the tilde), but I'm getting the wrong representation (A!rabe) using the widget.
How can I resolve this?
Thanks in advance.
This is probably an encoding problem: verify that the list of languages registered in your database has the same encoding than the page where you display the widget.
But why don't you use the sfWidgetFormI18nChoiceLanguage widget ?

Resources