HTML Logo by World Wide Web Consortium (www.w3.org). Click to learn more about our commitment to accessibility and standards.

Moving forward with Composr

ocPortal has been relaunched as Composr CMS, which is now in beta. ocPortal 9 will be superseded by Composr 10.

Head over to compo.sr for our new site, and to our migration roadmap. Existing ocPortal member accounts have been mirrored.


Make character encoding utf-8 as default

Login / Search

 [ Join | More ]
 Add topic 
Posted
Rating:
#92176 (In Topic #18498)
Avatar

Fan in training

I'd like to suggest to ocPortal crew to make it as default for next releases...

Hi all,


  I am just a newbie as for ocportal so excuse my newbie questions ;)
I have some experiences with other CMSs, a bit of php, CSS and JavaScript also. I'd like to give a try to this CMS due from teh descriptions it seems to be cool and even in the beginning I'll make just newbie design, it seems there is a way to grow up due its possibilities to make many interesting features.
That's why I'm trying and testing but I have to drop some words as for first feelings:

  As I can see (I've just installed it locally on linux with Bitnami Lampstack) the default character encoding is ISO-8859-1.
I've read many tutorials but I have to test it by my hand because the more tutorials I read the more I feel lost... :$

  I am sure the default settigns for utf-8 would be the best solution for most users because utf-8 supports almost all (European langs) and I have not to worry what language words I use on the pages. Why just ISO-8859-1 as a default ? :o
I was looking for where to change and I've found a tip that this - "$SITE_INFO['database_charset']='utf8';"should be added to info.php file.
Is it ok or is there any chance to have utf-8 as a default charset ?

Also I had to change in my httpd.conf config Apach file the directive in section <Directory> where I had to set "AllowOverride None" to "AllowOverride All" so the short URL could work.
This tip might help another newbie too.

  Although there are many tutorials on the web I'm still quit lost how to manage ocportal and some more newbie sections would be needed yet, IMHO ;)

  If there is any other cool & newbie source to learn up, let me know, pls.
Thanx.
Back to the top
 
Posted
Rating:
#92177
Avatar

utf8 is done via changing the 'charset' language string, the Internationalisation tutorial should cover it, or it automatically happens when importing a language pack from Launchpad.

What you spotted relates to the database communication character set (what ocPortal tells MySQL is in use for data sent into MySQL) and should probably be omitted because its autodetected by ocPortal, based on the defined character set mentioned above.

v1-v9 uses iso-8859-1 because PHP does not support Unicode. There are some extensions that may or may not be enabled (mbstring, iconv), that try an patch it in, but core PHP functions still won't support it. PHP6 was supposed to be out years ago and introduce Unicode, but it was cancelled. We didn't feel it right to make it the default using workarounds due to PHP6's imminent stable support.

Other PHP projects went down a different route, probably due to have had a more geo-distributed development team than us so felt more forced to do 'anything' to get passed PHP's deficiency here ;).

v10 will use unicode by default because our patching has worked fine now for a number of years, and it's clear PHP6 is not happening. v10 is our upcoming backend cleanup release.

Regarding httpd.conf, it's a good tip for people in your situation. We won't be documenting it officially as most people aren't in control of their own Apache config, and if they are they need to understand Apache configs in general. There are too many permutations of configuration for us to handle in the documentation without it becoming (even more ;)) confusing unfortunately.

Regarding documentation, you'll find the community is planning a new book :).


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#92178
Avatar

Fan in training

Hello,


  thanks for the reply.
I've read this - http://ocportal.com/docs/tut_intl.htm tutorial but it looks hard for me now to make the whole translation :-)
  I'm seeking just a solution that although I have set EN as default lang, when testing and creating some content, I'd like to have in the <head> of the site (page source) utf-8 and as for menu I'd use just captions in other than english lang. as well as the text for the content.

  All the rest (admin zone etc.) could remain in english, just for visitors I'd like to write (content and menu captions) in other than english and therefore the utf-8 is needed.
BTW, utf-8 is needed also in a case, when you have set En but if you have to use e.g. a foreigner's surname for example a norwegian surname, having some very special letters in it's surname or east european surname, there is utf-8 best for all cases here.

  Is there any easy/quick way how to force <head> to be used utf-8 even without full language pack translation ? :)
Thanks for help, in advance.
Back to the top
 
Posted
Rating:
#92179
Avatar

It's really easy - just go to Admin Zone > Style > Translate/re-phrase the software, select the global language file and change the 'charset' entry.


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#92187
Avatar

Fan in training

Thanks for reply but that's not what I meant.
I've found an add-on and imported it from Development section - Utf8.
Now all texts, site title etc. are correct and utf-8 in <head> is on.

Thanks anyway for your help.

I hope and I do wish let ocportal is not so hard (as e.g. joomla templates where is mixed Html with php like in a trash-dump :-)) and the learning progress will grow up although now I still cannot do much in this CMS ;-)
Back to the top
 
Posted
Rating:
#92188
Avatar

Actually that addon does the same as I suggested ;). It just changes that one language string.

I hope and I do wish let ocportal is not so hard (as e.g. joomla templates where is mixed Html with php like in a trash-dump :-))

Are you saying you want a trash-dump :lol:? You can if you want – if you use PHP in templates you'll see it warns you about security implications but also tells you how to enable it.


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
1 guests and 0 members have just viewed this: None
Control functions:

Quick reply   Contract

Your name:
Your message: