The Joomla! Forum ™



Forum rules


Please use the mailing list here: http://groups.google.com/group/joomla-dev-general rather than this forum.



Post new topic Reply to topic  [ 7 posts ] 
Author Message
PostPosted: Wed Jun 06, 2012 11:25 am 
User avatar
Joomla! Intern
Joomla! Intern

Joined: Tue Jan 22, 2008 8:01 pm
Posts: 61
hello, in the articles I've created a new form element (textarea type) where I need to save a string with special characters (à, é, ì, etc..).

When I save the article in the DB field it is saved a \u00c0 instead of À so when I print the value of the field in the template appears the code \u00c0 instead of the character.
In the admin interface everything works fine..

How can I display correctly the text in the template too?

_________________
Davide Taddei
http://davidetaddei.[URL banned].com


Top
 Profile  
 
PostPosted: Wed Jun 06, 2012 5:08 pm 
Joomla! Explorer
Joomla! Explorer

Joined: Fri Nov 11, 2011 9:43 pm
Posts: 432
Location: Chicago, IL
This is no different that using & instead of just the actual character & when saving items in the admin interface. Try using
Code:
À
instead of the actual character and see if it display proper.

As for a more permanent solution I wish I could offer more, being a native English speaker I rarely have to deal with special characters, but definitely am curious if there is a more comprehensive solution.

Found the HTML Friendly Code at:

http://webdesign.about.com/library/bl_htmlcodes.htm


Top
 Profile  
 
PostPosted: Thu Jun 07, 2012 7:46 am 
User avatar
Joomla! Intern
Joomla! Intern

Joined: Tue Jan 22, 2008 8:01 pm
Posts: 61
Hello, thank you rofr your reply, unfortunately the user that fills the text area needs to copy/paste the text from a word processor so he counldn't replace the characters with HTML entities.
Meantime I solved the problem with a str_replace on the characters code, anyway I would like to know the reason of the problem.

_________________
Davide Taddei
http://davidetaddei.[URL banned].com


Top
 Profile  
 
PostPosted: Thu Jun 07, 2012 3:47 pm 
Joomla! Explorer
Joomla! Explorer

Joined: Fri Nov 11, 2011 9:43 pm
Posts: 432
Location: Chicago, IL
Davide,

I recently had a major issue at my work which involved the exact same thing, copying and pasting articles in from word processors. If the user isn't copying the article into a text based editor like Notepad or Notepad++, he's copying over all kinds of unnecessary junk. As a result, sometimes the articles were encaplsed in CDATA tags and sometimes they weren't. If you have JCE (Joomla Content Editor) installed, after a test copy and paste of an article, go to the code view, usually the button looking like <>.

I would look at changing the textarea field filter attribute from what it is. If it's set to HTML try raw. This would be in the folder models/forms/myviewname.xml.


Top
 Profile  
 
PostPosted: Wed Jun 13, 2012 7:02 am 
User avatar
Joomla! Intern
Joomla! Intern

Joined: Tue Jan 22, 2008 8:01 pm
Posts: 61
Hello bbolli, actually in this case I have a text input box. What is strange is that the characters are displayed correctly in the box and with UTF-8 codes in the template

_________________
Davide Taddei
http://davidetaddei.[URL banned].com


Top
 Profile  
 
PostPosted: Wed Jun 13, 2012 2:39 pm 
Joomla! Explorer
Joomla! Explorer

Joined: Fri Nov 11, 2011 9:43 pm
Posts: 432
Location: Chicago, IL
Are you using Joomla parameters to define the field? Check the below link out for the field type "text" and the filter section.

http://docs.joomla.org/Text_form_field_type


Top
 Profile  
 
PostPosted: Wed Jun 13, 2012 2:53 pm 
User avatar
Joomla! Intern
Joomla! Intern

Joined: Tue Jan 22, 2008 8:01 pm
Posts: 61
Yes, of course, I know what we are talking about :-) I defined I new form field (the old Joomla! 1.5 parameters) and what is saved there is correctly displayed in the administrator interface but displays UTF-8 codes on the template and the phpmyadmin interface. Got it?

_________________
Davide Taddei
http://davidetaddei.[URL banned].com


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 



Who is online

Users browsing this forum: No registered users and 12 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group