CodeIgniter Forums
Codeigniter 1.7.2 UTF-8 Edition - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=22)
+--- Thread: Codeigniter 1.7.2 UTF-8 Edition (/showthread.php?tid=25691)

Pages: 1 2 3 4 5 6


Codeigniter 1.7.2 UTF-8 Edition - El Forum - 12-24-2009

[eluser]Phil Sturgeon[/eluser]
Several of CodeIgniter's libraries do use the Multi-byte functions but only if they exist. E.g:

Code:
// Set the character encoding in MB.
        if (function_exists('mb_internal_encoding'))
        {
            mb_internal_encoding($this->CI->config->item('charset'));
        }

You are right Demedes, CodeIgniter probably could do with using them a little more, but as I said I have never really had an issue with UTF-8 characters in PyroCMS.

For example, I wouldn't expect a Cyrillic character to pass a-z (alpha in Form_validation) out of the box, because it is NOT abcdefghijklmnopqrstuvwyz and that to me seems fine.

Where have you guys been having your UTF-8 troubles? It is very possible I am just missing something.


Codeigniter 1.7.2 UTF-8 Edition - El Forum - 12-24-2009

[eluser]Sbioko[/eluser]
Ok, I'll give an example. Here you are:
Code:
//Some method in controller
function test()
{
    echo strlen('тест');
}
This will output 8 without my package, and 4 with right UTF-8 support(you must replace strlen to utf8_strlen).


Codeigniter 1.7.2 UTF-8 Edition - El Forum - 12-24-2009

[eluser]Phil Sturgeon[/eluser]
Well this is not core CodeIgniter code is it, so why could you not use mb_strlen? If you need to write a UTF-8 app and do lots of string work, installing MB functions is a fairly simple requirement.

You suggested you had to re-write the core of CodeIgniter to get it working properly, this is only controller work...


Codeigniter 1.7.2 UTF-8 Edition - El Forum - 12-24-2009

[eluser]Sbioko[/eluser]
Yes, but as I saw, many of CI native libraries use, for example, trim or substr. If I will send them a non-english(for example, again) parameter, I will get unnormal symbols.

My package fixes all this problems. What are you want to discuss?


Codeigniter 1.7.2 UTF-8 Edition - El Forum - 12-24-2009

[eluser]Phil Sturgeon[/eluser]
Well I said where is it causing problems, and your demo was in a controller. Where is it actually causing problems? Validation, routing, text helpers, what? Smile


Codeigniter 1.7.2 UTF-8 Edition - El Forum - 12-24-2009

[eluser]Sbioko[/eluser]
Everything! :-) I will say again, if you want FULL UTF-8 compability, then just download and install my package.


Codeigniter 1.7.2 UTF-8 Edition - El Forum - 12-27-2009

[eluser]Mahyar Ss[/eluser]
[quote author="Demedes" date="1261515288"]Nobody needs this?[/quote]

hi Demedes,

yes i needed it most !!!

when i guery from DB, show character like "± سايتخوØ"

i think must use utf-8

can u help what i do?

what must i set database tables Collation?

thnx a lot


Codeigniter 1.7.2 UTF-8 Edition - El Forum - 12-27-2009

[eluser]Sbioko[/eluser]
CP-1251 does not support such symbols as Ù, Š and others. If you still have any questions, feel free to ask me!
Whith my package, you don't need any settings to work with UTF-8. You will just use it. Today, I hope, I will publish updated version of Codeigniter 1.7.2 UTF-8 Edition.


Codeigniter 1.7.2 UTF-8 Edition - El Forum - 12-27-2009

[eluser]Mahyar Ss[/eluser]
very thaaanks my friend Smile

i will use utf-8 edition then tell u about result...


Codeigniter 1.7.2 UTF-8 Edition - El Forum - 12-27-2009

[eluser]Sbioko[/eluser]
Ok, I'll wait!