Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Magento not allowing special characters like ä

Tags:

php

magento

I uploaded the csv of my products in my magento store. in CSV i am having the product names with special characters like ä . But on the front end those characters are showing some html tags like
"& auml;". I want to avoid such charactres. is there any way to solve the problem.

Thanks...

like image 419
user1713694 Avatar asked Oct 03 '12 06:10

user1713694


2 Answers

Try like this may it will help you where you want to display product name

<?php 

    html_entity_decode(htmlentities(utf8_decode(strip_tags($_newProduct['name']))));

   // where $_newProduct is the collection of product
 ?>

Or Try something like this

The solution for these problems is to add

AddDefaultCharset Off

in the .htaccess file in the magento root directory. If you still have problems, ramp up to this:

AddDefaultCharset UTF-8

OR

Go to .htaccess file and remove # from

AddDefaultCharset UTF-8

and

open the your csv file in .txt format and Save As under UTF-8 and then import the data in magento

Your special character will also get import in magento admin without any error

hope it will help you

like image 177
drsndodiya Avatar answered Nov 15 '22 00:11

drsndodiya


Thanks for your reply. I used only html_entity_decode(); . and it gives me the proper output. Thanks.

like image 24
user1713694 Avatar answered Nov 14 '22 22:11

user1713694