daGrevis Posted September 22, 2010 Report Share Posted September 22, 2010 (edited) Sveiki, Problēma veca kā pasaule, bet tas, ko no galvas atcerējos un izdarīju, nedeva vēlamos rezultātus. Lūk, šī koda rindiņa izvada 8, bet, protams, pareizā atbilde būtu 4... =P <?= strLen('āāāā'); ?> Tad nu Es mēģināju šādi, bet, diemžēl bez rezultātiem... =( mb_internal_encoding('UTF-8'); mb_http_output('UTF-8'); Idejas? =P Edited September 22, 2010 by daGrevis Quote Link to comment Share on other sites More sharing options...
viena tante Posted September 22, 2010 Report Share Posted September 22, 2010 $garums = mb_strlen('āāāā', 'UTF-8'); Quote Link to comment Share on other sites More sharing options...
Faks Posted September 22, 2010 Report Share Posted September 22, 2010 (edited) $y = strLen('āāāā'); echo $y; strada ka pulkstenitis :) labi gan iznaca abi vienlaikus :D Edited September 22, 2010 by Faks Quote Link to comment Share on other sites More sharing options...
Faks Posted September 22, 2010 Report Share Posted September 22, 2010 (edited) $garums = mb_strlen('āāāā', 'UTF-8'); taus nederes vins skaita nepareizi :0 bet mans vis ok pareizi paradija ka ir 4 ieksa :) te bus ejos piemers mans ar tavu Te Edited September 22, 2010 by Faks Quote Link to comment Share on other sites More sharing options...
viena tante Posted September 22, 2010 Report Share Posted September 22, 2010 (edited) taus nederes vins skaita nepareizi :0 bet mans vis ok pareizi paradija ka ir 4 ieksa :) te bus ejos piemers mans ar tavu Te Negribu neko sliktu teikt :) P.S un ja ieraksta Tavā 5 "ā", tad parāda 2,5? :D Edited September 22, 2010 by viena tante Quote Link to comment Share on other sites More sharing options...
Vhubuo Posted September 23, 2010 Report Share Posted September 23, 2010 Lai saprastu kapec tā Quote Link to comment Share on other sites More sharing options...
Kemito Posted September 23, 2010 Report Share Posted September 23, 2010 Klausi, ko raksta viena tante un būs labi! Faks - Sarežģīt situāciju nav prāta darbs :( Quote Link to comment Share on other sites More sharing options...
Roberts.R Posted September 23, 2010 Report Share Posted September 23, 2010 pa visam vienkāršāk: ANSI viens simbols = 1b UTF-8 viens simbols = 1b UTF-8 viens simbols ar garumzīmi = 2b Quote Link to comment Share on other sites More sharing options...
Kavacky Posted September 24, 2010 Report Share Posted September 24, 2010 pa visam vienkāršāk: ANSI viens simbols = 1b UTF-8 viens simbols = 1b UTF-8 viens simbols ar garumzīmi = 2b Nē:"UTF-8 encodes each character (code point) in 1 to 4 octets (8-bit bytes). The first 128 characters of the Unicode character set (which correspond directly to the ASCII) use a single octet with the same binary value as in ASCII." Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.