Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.php > #8921
| Path | csiph.com!usenet.pasdenom.info!poup.poupinou.org!news.muarf.org!nntpfeed.proxad.net!proxad.net!feeder2-2.proxad.net!newsfeed.arcor.de!newsspool2.arcor-online.net!news.arcor.de.POSTED!not-for-mail |
|---|---|
| Content-Type | text/plain; charset="UTF-8" |
| Message-ID | <5795699.ZddputCnCo@PointedEars.de> (permalink) |
| From | Thomas 'PointedEars' Lahn <PointedEars@web.de> |
| Reply-To | Thomas 'PointedEars' Lahn <php@PointedEars.de> |
| Organization | PointedEars Software (PES) |
| Date | Sat, 30 Mar 2013 20:18:06 +0100 |
| User-Agent | KNode/4.8.5 |
| Content-Transfer-Encoding | 8Bit |
| X-Face | %i>XG-yXR'\"2P/C_aO%~;2o~?g0pPKmbOw^=NT`tprDEf++D.m7"}HW6.#=U:?2GGctkL,f89@H46O$ASoW&?s}.k+&.<b';Md8`dH6iqhT)6C^.Px|[=M@7=Ik[_w<%n1Up"LPQNu2m8|L!/3iby{-]A+#YE}Kl{Cw$\U!kD%K}\2jz"QQP6Uqr],./"?;=4v |
| Face | iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAGFBMVEXTxa4RFk5dUWANED8PFEfy7+MGBiW+n3ZNF/QuAAACaElEQVQ4jVXUwVOcMBQG8Dc7Rc4PUntdWV2uxjDpGaGeozOp1woar4jd5t/v9wLstMwsA/ntlxdCAgUc1hjTc9/JCZfGoo3wG3HdmdAWrIJRHe7GM/TmpY5VFefuVcAkkPbLIaN8rmPmjloyZxgyR3GuJ4K0AGtJ2htz8o7yqikm759fldQXaMpbDzjKAG+8v+AugVTOPO5DOjLvGtUYQwh0CPjnVMyGd+8/GfUB5nLKJDD2aLDh5HYyMDJGDwQIo2ZmZcKbowNmAdB/AzyFhrmF2MHRb0QJJfaAnwGB6orZhoykLzJtGwF/xpYxI1dswomiUj3gTuAIqCn/4C7cULwGNBtwMTk3Y4LfKB5YUaOKBKYtpplm7u0vip8tU1NWWyI/7XdcSuIDoMt6rVHMWT0DbjHPGqDqZVSa6zleLcUTcIKLoMv3ueJluALtAo9B302zPPlrtiVScRdCjXvVh3e3JpYa/jjkuC9N+LrBMlz/eAN4eQijX2EdLo6c5tGGHwLyHFtXk89dDGHwCVhG9T0S/j55AhRZgkMCmUQXJ49TnS1wnQDvw0eAh9ICeMmEFbCnPMFzjAvsWoEWEFdYEx+S0MoUZ1gT1wId8+AF3Bl2OoEu906AUHx5VLw/gXYg/x84loOah/2UYNrgiwSwGO7RfUzVBbx/kgpckumGOi6QirtD6gkLTitbnxNol47S2jVc2vsN5kPqaAHT8uUdAJM4v/DanjYOwmUjWznGfwB7sGtAtor5BgofDuzaRj4kSQAqDakTsKORa3Q3xKi3gE1fhl71KRMqrdZ2AWNNg/YOhQyrVBnb+i+nEg4bsDA+egAAAABJRU5ErkJggg== |
| Subject | Re: Unicode support |
| Newsgroups | comp.lang.php |
| References | <121c60da-4c3c-4ecd-bae8-5375132c19de@p5g2000yqj.googlegroups.com> <kic3m8$h5u$1@dont-email.me> <98cc9763-7f32-4ca7-9d52-f698c222f246@n2g2000yqg.googlegroups.com> <2206171.g8a4ScMWm9@PointedEars.de> <XnsA189B71C813AEdougmilmaccom@78.46.70.116> <kide60$df1$1@speranza.aioe.org> <XnsA189C3E70FCE8dougmilmaccom@78.46.70.116> <ar015sF2nu9U1@mid.uni-berlin.de> <1l036uh.tti447p1ww4uN%adrian@poppyrecords.invalid.invalid> <ar0svgF90ntU1@mid.uni-berlin.de> <1396959.N3YltuB2Mg@PointedEars.de> <kiga62$mn9$1@speranza.aioe.org> <2177849.7jHvAoTLnH@PointedEars.de> <kj6nf9$46c$1@speranza.aioe.org> <2391743.1T8NqQ3TJ8@PointedEars.de> <kj6t3n$e1r$1@news.albasani.net> <kj6uci$of0$1@speranza.aioe.org> |
| MIME-Version | 1.0 |
| Lines | 38 |
| NNTP-Posting-Date | 30 Mar 2013 20:18:07 CET |
| NNTP-Posting-Host | 6bd629fd.newsspool1.arcor-online.net |
| X-Trace | DXC=mBN1TjCGo[j>jlK2>IgHGdic==]BZ:afn4Fo<]lROoRankgeX?EC@@`KPeR?^YhTLgDZm8W4\YJNlb@mF9jNikdeBoKGPB=12AgTaH3kXcWb[k |
| X-Complaints-To | usenet-abuse@arcor.de |
| Xref | csiph.com comp.lang.php:8921 |
Show key headers only | View raw
Christoph Becker wrote:
> I am more concerned about the number of characters the string holds.
> Say, I want to get the last character:
>
> $str = '€';
> echo $str[2];
>
>> Because lack of precision in font reproduction, or even in guaranteeing
>> which font may be selected, renders the former an 'open' question.
>>
>> strlen('€')===3 is in fact the correct answer.
That depends on the character encoding of the source code. 3 is the correct
answer for an *UTF-8*-encoded U+20AC EURO SIGN character, which is then
encoded E2 82 AC. [1]
> I suppose most *higher level languages* define the length of a string as
> the number of characters the string holds. Cf. ECMAScript's length
> property and TCL's [string length]. Even PHP's mb_strlen() returns the
> number of characters.
AISB, unfortunately the “length” property of ECMAScript String instances is
not a good example in that regard as it does _not_ mean the number of
characters but the number of 16-bit units (UTF-16 code units, usually).
That is only less obvious than with UTF-8 because all Unicode characters in
the BMP can be encoded using only one such unit. (I am working on a
workaround; you could call it “an mb_strlen() for ECMAScript
implementations”.)
PointedEars
___________
[1] <http://www.rishida.net/tools/conversion/>
--
Danny Goodman's books are out of date and teach practices that are
positively harmful for cross-browser scripting.
-- Richard Cornford, cljs, <cife6q$253$1$8300dec7@news.demon.co.uk> (2004)
Back to comp.lang.php | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
mysql dynamic binding and pass-by-ref deprecated oldyork90 <oldyork90@yahoo.com> - 2013-03-19 20:49 -0700
Re: mysql dynamic binding and pass-by-ref deprecated Jerry Stuckle <jstucklex@attglobal.net> - 2013-03-20 06:42 -0400
Re: mysql dynamic binding and pass-by-ref deprecated oldyork90 <oldyork90@yahoo.com> - 2013-03-20 07:09 -0700
Re: mysql dynamic binding and pass-by-ref deprecated Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-03-20 15:29 +0100
Re: mysql dynamic binding and pass-by-ref deprecated The Cat in the Hat <doctor@suess.com> - 2013-03-20 21:58 +0000
UTF-8 charset (was: mysql dynamic binding and pass-by-ref deprecated) Christoph Becker <cmbecker69@gmx.de> - 2013-03-20 23:45 +0100
Re: UTF-8 charset (was: mysql dynamic binding and pass-by-ref deprecated) The Cat in the Hat <doctor@suess.com> - 2013-03-20 23:13 +0000
Re: UTF-8 charset The Natural Philosopher <tnp@invalid.invalid> - 2013-03-20 23:31 +0000
Re: UTF-8 charset "M. Strobel" <sorry_no_mail_here@nowhere.dee> - 2013-03-21 10:11 +0100
Re: UTF-8 charset adrian@poppyrecords.invalid.invalid (Adrian Tuddenham) - 2013-03-21 14:31 +0000
Re: UTF-8 charset The Natural Philosopher <tnp@invalid.invalid> - 2013-03-21 16:22 +0000
Re: UTF-8 charset "M. Strobel" <sorry_no_mail_here@nowhere.dee> - 2013-03-21 18:05 +0100
Re: UTF-8 charset Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-03-22 01:17 +0100
Re: UTF-8 charset Christoph Becker <cmbecker69@gmx.de> - 2013-03-22 01:55 +0100
Unicode support (was: UTF-8 charset) Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-03-22 02:16 +0100
Re: Unicode support Christoph Becker <cmbecker69@gmx.de> - 2013-03-30 13:57 +0100
Re: Unicode support Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-03-30 14:25 +0100
Re: Unicode support The Natural Philosopher <tnp@invalid.invalid> - 2013-03-30 14:33 +0000
Re: Unicode support Christoph Becker <cmbecker69@gmx.de> - 2013-03-30 15:55 +0100
Re: Unicode support The Natural Philosopher <tnp@invalid.invalid> - 2013-03-30 18:04 +0000
Re: Unicode support Christoph Becker <cmbecker69@gmx.de> - 2013-03-30 21:26 +0100
Re: Unicode support The Natural Philosopher <tnp@invalid.invalid> - 2013-03-30 21:26 +0000
Re: Unicode support Christoph Becker <cmbecker69@gmx.de> - 2013-03-30 23:14 +0100
Re: Unicode support The Natural Philosopher <tnp@invalid.invalid> - 2013-03-30 22:29 +0000
Re: Unicode support "M. Strobel" <sorry_no_mail_here@nowhere.dee> - 2013-03-31 14:10 +0200
Re: Unicode support The Natural Philosopher <tnp@invalid.invalid> - 2013-03-31 13:41 +0100
Re: Unicode support "M. Strobel" <sorry_no_mail_here@nowhere.dee> - 2013-03-31 19:12 +0200
Re: Unicode support Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-03-30 20:18 +0100
Re: Unicode support Christoph Becker <cmbecker69@gmx.de> - 2013-03-30 21:05 +0100
Re: Unicode support Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-03-30 21:19 +0100
Re: Unicode support "M. Strobel" <sorry_no_mail_here@nowhere.dee> - 2013-03-31 14:06 +0200
Re: Unicode support "M. Strobel" <sorry_no_mail_here@nowhere.dee> - 2013-04-02 19:59 +0200
Re: Unicode support The Natural Philosopher <tnp@invalid.invalid> - 2013-03-30 14:29 +0000
Re: UTF-8 charset The Natural Philosopher <tnp@invalid.invalid> - 2013-03-22 10:50 +0000
Re: UTF-8 charset "M. Strobel" <sorry_no_mail_here@nowhere.dee> - 2013-03-22 09:46 +0100
Re: UTF-8 charset "M. Strobel" <sorry_no_mail_here@nowhere.dee> - 2013-03-21 18:36 +0100
Re: UTF-8 charset [OT] adrian@poppyrecords.invalid.invalid (Adrian Tuddenham) - 2013-03-21 18:22 +0000
Re: UTF-8 charset [OT] "Peter H. Coffin" <hellsop@ninehells.com> - 2013-03-21 15:00 -0500
Re: UTF-8 charset [OT] Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-03-22 01:47 +0100
Re: UTF-8 charset The Natural Philosopher <tnp@invalid.invalid> - 2013-03-20 23:20 +0000
Re: UTF-8 charset Scott Johnson <noonehome@chalupasworld.com> - 2013-03-20 16:39 -0700
Re: mysql dynamic binding and pass-by-ref deprecated Jerry Stuckle <jstucklex@attglobal.net> - 2013-03-20 23:29 -0400
OT: Xnews mime-proxy (was: mysql dynamic binding and pass-by-ref deprecated) BootNic <bootnic.bounce@gmail.com> - 2013-03-21 10:53 -0400
Re: mysql dynamic binding and pass-by-ref deprecated oldyork90 <oldyork90@yahoo.com> - 2013-03-21 06:43 -0700
csiph-web