Norwegian Special character not supporting in Codeigniter 2.0.2 - codeigniter

I am trying to save some special norwegian characters like æøå ÆØÅ but this not saved properly in database. Sometimes such characters get trimmed and sometimes shown like æøå Ã
I had used htmlentities to support such characters in Codeigniter 1.7 and works well.
So the problem came with new version of Codeigniter.
Any ideas?

I had a similar issue with one of our native languages in India (that had accented charcters), and I resolved it by changing charset values to utf8_unicode_ci in database (table and fields compilation) and files related with data capture and display of data.
Let me know that helps you.

Related

Issues with using UTF-8 with PHPMailer

I'm using PHPMailer 5 to send plain text emails from forms. It looks like some users are pasting content from word into the textarea fields and the resulting email comes out with lots of non-readable characters (e.g. “).
I've tried adding $mail->CharSet = 'UTF-8'; and that seems to fix the tests I've done (e.g. bullet lists are now coming through properly).
$mail = new PHPMailer;
$mail->CharSet = 'UTF-8';
$mail->ContentType = 'text/plain';
$mail->IsHTML(false);
Are there any security issues or other issues that could come up from setting the character set to UTF-8?
You're doing it right. PHPMailer defaults (as does PHP's internal mail function) to the ISO-8859-1 character set because that can be used in the absence of the mbstring PHP extension which is not available by default - and if you don't have that extension, UTF-8 support won't work. Once you switch to using UTF-8, your entire toolchain must also use UTF-8 - your editors, your database, your database connection. You also need to be wary of functions like strlen and substr, which are not UTF-8-safe because they work in bytes, not chars (which may be more than 1 byte long). Whenever one of those things gets it wrong, you'll see the kind of corruption you have. It's a good exercise to stick in some difficult strings to test with (though see my answer about that) to make sure it comes through unscathed.
Unfortunately, MS Word is one of the best examples of how to do UTF-8 badly; it often riddles the text with unnecessary unusual characters, extra control chars etc, so I would advise doing some heavy filtering on your inputs - editors like CKEditor have built-in filters to help deal with Word's issues. That doesn't have anything to do with PHPMailer, it's a just a common problem with dealing with input that has been touched by Word.
The only thing you're doing wrong is using PHPMailer 5.x; current version is 6.x.

No UTF8 encoding in Magento blocks

I am using some widgets for showing new/bestselling items on my frontpage. This widgets need some blocks with the articles in it.
Recently, I moves my magento folder and database to another server and since then, some unicode signs (€, ä, ü, etc) are not shown correctly anymore. First, I thought this could be a database issue, but the encoding ist the same. Whatever non-ascii sign I type it, gets wrong like  € or ä.
Do you know what the issue for this problem can be and how to solve it? I am confused, because I did not change any files or settings.
The "Binary" transfer mode of FTP copies files exactly, byte for byte.
Try this method.

php wrong utf8 characters from mysql using Twig

Im doing some webapp on php, im using my own MVC pattern, including Activerecord, and Twig templates.
So i have some problems with charset, there is some details about my encoding.
Im using polish characters
Mysql encoding is set to utf8_unicode_ci (i tried urf8_general_ci)
Twig template have standard html-5 header with utf8 encoding
Im not sure about files encoding (using netbeans), but sublime text 2 console on view.encoding() says: u'Undefined', i dont try to change it yet.
Problem description:
When im using polish characters like ółąćź in Twig template file - everything looks good, there is no problem. I tried to use:
echo $twig->render('hello.tpl', array('locations'=>"óóśąłłąś"));
And in this case is no problem too.
But when I get my data from database the polish characters are like "�"
I tried to get data by structural php mysql call, and by activerecord - ex. Model::all().
It allways have problems with characters from database in Twig template.
And yes, i set my active record config like: dbname?charset=utf8
The answer is funny.
I tried again to do it structural and i used this query:
mysql_query("SET NAMES 'utf8'", $dbLink);
It works, all characters are visible now.
On activerecord the problem still apears, so i updated activerecord to nigtly build, and everything works now !

How to convert French accented words into codes for Magento 1.8?

I have two versions for my store - English and French. And I am doing the translation from English to French in app/locale/fr_FR/Mage_Page.csv
I notice that I have to use some codes for certain French characters, such as En-tête de page for tête de page.
So if I have French words like 100% Magasinage sécurisé, how can use convert it into codes like En-tête de page?
I think it can come from the encoding of your file Mage_Page.php. If you use linux, I think that you have it in your file's properties and if you use Windows, you can check with notepad++. Richard B. gave a good link that in my opinion might solve the problem.
I'm using french on all the magento website that we produce and I do not have any problem like that so it must come from the encoding of your file.
One last thing : if your file is utf8 encoded, it means that your text was imported from a different one and editor did what it could but not successfully to change the characters (can happen with text from excel).

convert ascii characters to ruby encoding

I'm testing a feature with watir and running into an issue with validating ascii characters in the html.
I'm grabbing the product description from a database like so 'Company® Some Product' and use it as the string that i'm validating against.
and it shows up that way in the html. However Ruby is looking for Company\u00AE Some Product, so my test is failing.
Anyone have any solutions for getting around these special characters when they turn up?
HTML Entities gem may help:
http://htmlentities.rubyforge.org/
http://htmlentities.rubyforge.org/doc/

Resources