Welcome Guest, Not a member yet? Register   Sign In
Codeigniter 1.7.2 UTF-8 Edition
#11

[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.
#12

[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).
#13

[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...
#14

[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?
#15

[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
#16

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

[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
#18

[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.
#19

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

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

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




Theme © iAndrew 2016 - Forum software by © MyBB