Unicode charset (UTF-8) in b2evo

 
Post new topic   Reply to topic   printer-friendly view    b2evolution Forum Index -> Internationalization & Localization
View previous topic :: View next topic  
Author Message
sam2kb
da ruski mafia

Joined: 02 Dec 2007
Posts: 2927
Reputation: 162.4Reputation: 162.4 add or subtract from this member's reputationadd or subtract from this member's reputation
votes: 53

PostPosted: Sat Dec 29, 2007 21:29    Post subject: Unicode charset (UTF-8) in b2evo Reply with quote

You may also want to read this post: HOW-TO: Configure b2evolution for non-English posts

Unicode charset (UTF-8) in b2evo

    1. Go to phpMyAdmin to create a database and set up its collation to utf8_unicode_ci.

    2. Find and edit this strings in /conf/_locales.php

PHP:
$force_io_charset_if_accepted 'utf-8';
$db_config['connection_charset'] = 'utf8'

    3. Install b2evo in this database.

This is it, but if you want to use another language by default, you need to make some more changes

    4. Download a language pack, unzip and upload it to /locales directory.

    5. Now go to Backoffice -> Global Settings -> Regional and change Default locale. Then change Blog locale in Blog settings >YOUR BLOG > Global


If you want to switch an existing b2evo database to use UTF-8 (when you upgrade it) do the following

    1. Buckup you database! And upgrade b2evo.

    2. Then you need to change collation from old to utf8_unicode_ci in each table. You have options to:
      a) Run SQL query
      b) Export your database in SQL format, open it in text editor and use find/replace.
      c) Go to phpMyAdmin and do it manually.


Last edited by sam2kb on Thu Oct 30, 2008 10:20; edited 5 times in total
Back to top
View user's profile Send private message Visit poster's website
fplanque
Core Developer
Core Developer

Joined: 13 Jun 2003
Posts: 863
Reputation: 193.4Reputation: 193.4 add or subtract from this member's reputationadd or subtract from this member's reputation
votes: 9

PostPosted: Wed Apr 16, 2008 12:44    Post subject: Reply with quote

It may be time to reconsider that part of b2evo by now.

Do you guys think we should make it all UTF-8 by default?

1) should the mysql tables be created as UTF-8 by default? (I believe most new users will have mysql servers that actually do support utf-8)

2) should we automatically upgrade all databases to UTF-8 in a future release? (might be tricky, I don't know)

3) should we convert all language packs to UTF-8 or at least have an UTF-8 version for each?

4) should we actually discard any language packs that are not UTF8 ?

5) should we make b2evo use UTF8 internally by default, although about 40% to 60% (not really sure yet) of the servers out there do not have the MB_STRING extension installed and therefore will not be able to handle NON ASCII text properly. That means if you blog in english you don't really care about not having MB_STRING, but if you blog with non ascii chars you may need to battle with your host or even switch to another host just to get mb_string.

What do you think?

_________________
François - Rambling on... State of the Evolution - fplanque.com
b2evolution project maintainer / main developer

Follow b2evolution on twitter and become a fan of b2evolution on facebook
Back to top
View user's profile Visit poster's website
sam2kb
da ruski mafia

Joined: 02 Dec 2007
Posts: 2927
Reputation: 162.4Reputation: 162.4 add or subtract from this member's reputationadd or subtract from this member's reputation
votes: 53

PostPosted: Wed Apr 16, 2008 15:08    Post subject: Reply with quote

I think there should be a checkbox or something, when it checked user can install/upgrade using UTF-8 (1,2,5)

And of course when he install using UTF-8 there must be a UTF-8 version available of all 2.x language packs.

_________________
Russian b2evolution | Download
Back to top
View user's profile Send private message Visit poster's website
deljr
New Poster
New Poster

Joined: 18 Aug 2008
Posts: 14
Reputation: 15.8Reputation: 15.8 add or subtract from this member's reputationadd or subtract from this member's reputation

PostPosted: Wed Aug 20, 2008 12:27    Post subject: Reply with quote

Even after running script fixcharset.php mentioned in http://forums.b2evolution.net/...hp?t=13366, I had to manually reset some of the values in the database, specifically:

Code:
evo_antispam
   aspm_string

evo_items__item
   post_content
   post_title
   post_urltitle
   post_url
   post_excerpt
   
evo_items__prerendering
   itpr_renderers
   itpr_content_prerendered

evo_comments
   comment_author
   comment_content


I've posted the details of how I got b2e to work with utf-8 for bilingual Russian-English posting here.
Back to top
View user's profile Send private message
Walter
Hooked :)
Hooked :)

Joined: 11 May 2004
Posts: 416
Reputation: 114.2 add or subtract from this member's reputationadd or subtract from this member's reputation
votes: 5

PostPosted: Mon Sep 01, 2008 10:43    Post subject: Reply with quote

For fplanque questions, I think:

1 - Yes
2 - Yes
3 - A UTF-8 version of language packs
4 - No, for a while Wink
5 - This is complicated, but I vote yes too.

_________________
[]'s
- Walter
http://b2evolution.waltercruz.com
Back to top
View user's profile Send private message Visit poster's website
Laibcoms
Expert
Expert

Joined: 27 Feb 2006
Posts: 649
Reputation: 149.3 add or subtract from this member's reputationadd or subtract from this member's reputation
votes: 9

PostPosted: Wed Mar 11, 2009 1:54    Post subject: Reply with quote

fplanque wrote:
It may be time to reconsider that part of b2evo by now.

Do you guys think we should make it all UTF-8 by default?


A strong YES!

fplanque wrote:
1) should the mysql tables be created as UTF-8 by default? (I believe most new users will have mysql servers that actually do support utf-8)


A resounding YES!!

fplanque wrote:
2) should we automatically upgrade all databases to UTF-8 in a future release? (might be tricky, I don't know)


A whisper of "no". This might break existing installations. IMO, make it as an option with a strong warning of what might happen, and that they should back-up first before attempting an upgrade-conversion.

fplanque wrote:
3) should we convert all language packs to UTF-8 or at least have an UTF-8 version for each?


IMO, all language packs must be UTF-8. With non-unicode version as an "alternative option".

fplanque wrote:
4) should we actually discard any language packs that are not UTF8 ?


Same as #3 above.

fplanque wrote:
5) should we make b2evo use UTF8 internally by default, although about 40% to 60% (not really sure yet) of the servers out there do not have the MB_STRING extension installed and therefore will not be able to handle NON ASCII text properly. That means if you blog in english you don't really care about not having MB_STRING, but if you blog with non ascii chars you may need to battle with your host or even switch to another host just to get mb_string.


Probably by now, 2009, more servers are supporting Unicode across the board, since it is now the thrust by almost all websites and CMS/Blogs platforms today. It also makes translations easier and well, if one wants to capture non-English end-users, then that platform and server must support Unicode.

fplanque wrote:
What do you think?


Change b2evolution, starting from v3.0 to use Unicode by default. From the posts/locale, to the DB-table creation, to the DB Connection, to the files (php/html/css) being saved as UTF-8 (however, no BOM [BOM is required only on UTF-16 and UTF-32]).

When it comes to locale/translations, the main thrust of all language packs from b2evo v3 should be unicode, particularly UTF-8 (IMO, we dont really need UTF-16 and UTF-32 yet). If there is a request of a non-unicode language pack, then that's the only time that version should be provided - with a specific note that it is better to use Unicode today.

Finally, b2evolution will be able to capture more users in non-English nations like China, Japan, and Korea - where blogging is huge - surpasses the rest of the world combined. (Okay, I maybe exaggerating Razz )

_________________
Theme Conversions for v3.x
Follow me @jcsesecuneta Blog: Snow World; gameshogun; ASEAN: Asia's Perfect 10
OS: Ubuntu GNU/Linux
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
yakogg
Muppet

Joined: 29 May 2010
Posts: 2
add or subtract from this member's reputationadd or subtract from this member's reputation

PostPosted: Sat May 29, 2010 8:30    Post subject: Reply with quote

thank you very much Laibcoms.
*edit : spammers are so unimaginative, your crap removed
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    b2evolution Forum Index -> Internationalization & Localization All times are GMT - 5 Hours
Page 1 of 1


 
Jump to:  
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 vote in polls in this forum
b2evolution Support Forum RSS Feed Forums powered by php Bulletin Board