Re: [PHP] Convert UTF-8 to PHP defines

2010-05-31 Thread Angus Mann

Dear Sir/Madam

Please unsubscribe Angus Mann angusm...@pobox.com from your database.  My 
husband passed away 6 May 2010.


Thank you
Sonya Mann


- Original Message - 
From: "tedd" 

To: 
Sent: Monday, May 31, 2010 12:20 AM
Subject: Re: [PHP] Convert UTF-8 to PHP defines



At 10:20 PM +0200 5/29/10, Nisse =?utf-8?Q?Engstr=C3=B6m?= wrote:

On Sat, 29 May 2010 10:16:39 -0400, tedd wrote:


 At 7:15 AM +0200 5/29/10, Nisse =?utf-8?Q?Engstr=C3=B6m?= wrote:


No. There are no glyphs in Unicode. This is spelled out for
you in chapter 2, figure 2-2. "Characters versus Glyphs".



 Code points are simply unique numbers assigned to specific characters
 in an approved char set. To better understand which character is
 represented a representative Glyph is used -- what else would we use,


Right. I should have phrased that differently.


 a chicken?


U+9e21 ? U+540D ?


LOL

I forgot that the word chicken appears in several other languages as a 
single character. Interesting to note that in the Chinese Dictionary, the 
character "U+9e21" Chicken (ji) is interchangeable with prostitution.


Cheers,

tedd

--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Convert UTF-8 to PHP defines

2010-05-30 Thread tedd

At 10:20 PM +0200 5/29/10, Nisse =?utf-8?Q?Engstr=C3=B6m?= wrote:

On Sat, 29 May 2010 10:16:39 -0400, tedd wrote:


 At 7:15 AM +0200 5/29/10, Nisse =?utf-8?Q?Engstr=C3=B6m?= wrote:


No. There are no glyphs in Unicode. This is spelled out for
you in chapter 2, figure 2-2. "Characters versus Glyphs".



 Code points are simply unique numbers assigned to specific characters
 in an approved char set. To better understand which character is
 represented a representative Glyph is used -- what else would we use,


Right. I should have phrased that differently.


 a chicken?


U+9e21 ? U+540D ?


LOL

I forgot that the word chicken appears in several other languages as 
a single character. Interesting to note that in the Chinese 
Dictionary, the character "U+9e21" Chicken (ji) is interchangeable 
with prostitution.


Cheers,

tedd

--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Convert UTF-8 to PHP defines

2010-05-29 Thread Nisse Engström
On Sat, 29 May 2010 10:16:39 -0400, tedd wrote:

> At 7:15 AM +0200 5/29/10, Nisse =?utf-8?Q?Engstr=C3=B6m?= wrote:
>>
>>No. There are no glyphs in Unicode. This is spelled out for
>>you in chapter 2, figure 2-2. "Characters versus Glyphs".

> Code points are simply unique numbers assigned to specific characters 
> in an approved char set. To better understand which character is 
> represented a representative Glyph is used -- what else would we use, 

Right. I should have phrased that differently.

> a chicken?

U+9e21 ? U+540D ?


/Nisse

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Convert UTF-8 to PHP defines

2010-05-29 Thread tedd

At 7:15 AM +0200 5/29/10, Nisse =?utf-8?Q?Engstr=C3=B6m?= wrote:


No. There are no glyphs in Unicode. This is spelled out for
you in chapter 2, figure 2-2. "Characters versus Glyphs".


*blink* *blink* *blink*

I read it, but that's not addressing the issue here -- that's 
something different.


You are not understanding the difference between characters, fonts, 
glyphs, and code points.


Here are some definitions taken directly from a Unicode Standard that 
might help:


-- quote

Character. The smallest component of written language that has 
semantic-value; refers to the abstract meaning and/or shape, rather 
than a specific shape (see also glyph), though in code tables some 
form of visual representation is essential for members understanding.


Font. A collection of glyphs used for the visual depiction of 
character data. A font is often associated with a set of parameters 
(for example, size posture, weight, and serifness), which, when set 
to particular values, generates a collection of imaginable glyphs.


Glyph. (1) An abstract for that represents one or more glyph images. 
(2) A synonym for "glyph image". In displaying Unicode character 
data, one or more glyphs may be selected to depict a particular 
character. These glyphs are selected by a rendering engine during 
composition and layout processing.


-- unquote

As such, you cannot claim "There are no glyphs in Unicode" for that is silly.

Code points are simply unique numbers assigned to specific characters 
in an approved char set. To better understand which character is 
represented a representative Glyph is used -- what else would we use, 
a chicken?


I may have been liberal in my use of the term "Glyph" in previous 
brief email, but "Glyph" in Unicode has a special meaning. The Glyph 
'A' is 'A' regardless of if it is Helvetical or Times, bold or 
italic, 12pt or 24pt glyph. Likewise the Yin-Yang symbol is a Glyph 
that has a single code point regardless of if it is red and black or 
green and blue glyph. But the point is -- there is a unique code 
point (041 HEX) for the Latin 'A' Glyph and one unique code point 
(262F HEX) for the Miscellaneous Symbols Yin-Yang Glyph -- WITH -- a 
representative Glyph in the Unicode table defining each code point!


So, when I say that just about every Glyph in the world has been 
provided a code point I am basically and technically correct -- 
excepting of course those glyphs that are not considered appropriate 
for inclusion or are variation glyphs of the representative Glyph 
that is already included -- understand?


After all is said and done, what is Unicode all about? It is 
assigning a universal and unique code point system to Glyphs that are 
considered to be appropriate representative members of abstract 
written forms of communication. But of course those are Glyphs for 
what else could they be?


Cheers,

tedd

--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Convert UTF-8 to PHP defines

2010-05-28 Thread Nisse Engström
On Fri, 28 May 2010 16:52:09 -0400, tedd wrote:

> At 8:52 PM +0200 5/28/10, Nisse =?utf-8?Q?Engstr=C3=B6m?= wrote:
>>On Fri, 28 May 2010 11:13:35 -0400, tedd wrote:
>>
>>  > As is my understanding, UTF-8 will accommodate all the languages
>>>  (glyphs) of the world and then some. It will be a while before we
>>>  need UTF-16 or UTF-32 but those are just a larger super-sets.

Again:

>>The theoretical limits are:
>>
>>   UTF-8   [0 - 7fff]
>>   UTF-16  [0 -   10]
>>   UTF-32  [0 - ]

In what way are UTF-16 and -32 super-sets of UTF-8?

>>Also, there are many, many, *many* more glyphs than
>>characters (code point) in the world. As an example,
>>www.fonts.com lists 165,125 fonts. Every one has a
>>*different* glyph for the characer "A"...

> As you say, UTF-8 has a range of 0 to 7FFF

No, I said that's the theoretical range. It is restricted
to [0-10] according to current specifications.

> If you spend some time looking at the numerous char sets that Unicode 
> offers you will see that just about every symbol known to man has 
> been cataloged

Yes. (Except those that are missing).

> every language in the world and glyph known to man has been 
> included -- a truly massive project.

No. There are no glyphs in Unicode. This is spelled out for
you in chapter 2, figure 2-2. "Characters versus Glyphs".


/Nisse

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Convert UTF-8 to PHP defines

2010-05-28 Thread tedd

At 8:52 PM +0200 5/28/10, Nisse =?utf-8?Q?Engstr=C3=B6m?= wrote:

On Fri, 28 May 2010 11:13:35 -0400, tedd wrote:

 > As is my understanding, UTF-8 will accommodate all the languages

 (glyphs) of the world and then some. It will be a while before we
 need UTF-16 or UTF-32 but those are just a larger super-sets.


*blink*

They are all capable of representing the full Unicode
range, which is restricted to U+ - U+10.

The theoretical limits are:

  UTF-8   [0 - 7fff]
  UTF-16  [0 -   10]
  UTF-32  [0 - ]

Also, there are many, many, *many* more glyphs than
characters (code point) in the world. As an example,
www.fonts.com lists 165,125 fonts. Every one has a
*different* glyph for the characer "A"...

/Nisse


*blink* *blink*

As you say, UTF-8 has a range of 0 to 7FFF

Forgive me, but isn't that 2,147,483,647 (DEC) code points?

Please note that 165,125 * 48 (upper/lower case) is only 7,925,952 
code points -- IF -- each letter of each font was to have it's own 
code point, which is not the case for Unicode.


Code points are assigned to specific char sets that belong to 
specific language sets, such as English being assigned to the code 
point range that is common with ASCII. From that, we can have as many 
fonts as your software can handle. However, ASCII 65 DEC (41 HEX) or 
code point 65 (41 HEX) is still tied to the letter "A" regardless of 
if it is Helvetical or Times. So, don't confuse code points with 
fonts.


If you spend some time looking at the numerous char sets that Unicode 
offers you will see that just about every symbol known to man has 
been cataloged -- even Klingon was considered. From Dingbats to 
Architectural symbols, from simplified Chinese to traditional 
Chinese, from Greek to Cherokee, from skull/cross-bones to yin/yang 
symbol, every language in the world and glyph known to man has been 
included -- a truly massive project.


IMO, it will be a while before we use up all the range Unicode code 
points provides.


Cheers,

tedd

--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Convert UTF-8 to PHP defines

2010-05-28 Thread Nisse Engström
On Fri, 28 May 2010 11:13:35 -0400, tedd wrote:

> Bob wrtote:
> 
>>>The real question is whether unicode is even relevant now that the UTF
>>>series is available.
> 
> Ashley answered:
> 
>>Bob, UTF is unicode (Unicode Transformation Format)

Or more precisely, UTF-{8,16,32} are different ways to
serialize Unicode code points into sequences of octets
that makes it possible to store and transmit Unicode
data.

> Yes, Ashley is correct. UTF-8 is Unicode, as is UTF-16 and UTF-32, 
> which all use different a number of bytes for each code point. Both 
> UTF-8 and UTF-16 are variable length whereas UTF-32 is a fixed length 
> of four bytes per code point.
> 
> As is my understanding, UTF-8 will accommodate all the languages 
> (glyphs) of the world and then some. It will be a while before we 
> need UTF-16 or UTF-32 but those are just a larger super-sets.

*blink*

They are all capable of representing the full Unicode
range, which is restricted to U+ - U+10.

The theoretical limits are:

  UTF-8   [0 - 7fff]
  UTF-16  [0 -   10]
  UTF-32  [0 - ]

Also, there are many, many, *many* more glyphs than
characters (code point) in the world. As an example,
www.fonts.com lists 165,125 fonts. Every one has a
*different* glyph for the characer "A"...


/Nisse

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Convert UTF-8 to PHP defines

2010-05-28 Thread tedd

At 8:33 PM +0100 5/27/10, Ashley Sheridan wrote:
Tedd, does that URL actually go anywhere, as I got nothing when I 
tried visiting it, both the actual URL and the punycode version.


Ash:

Try it again (it worked for me).

In any event, the link was supposed to be redirected to this site:

http://xn--fci.com

If you run Safari, then the url will be shown as a check-mark.

My most popular IDNS site is square-root dot com (option v):

http://xn--19g.com

The story about that site is on the web page -- you may read if interested.

The site receives over 150 unique Mac visitors per day and that 
number keeps climbing -- I don't know why. For example, one day I had 
over 800 visitors from Spain -- why???


Obviously, I'm trying to sell the domain (for 6 figures), but have 
had no takers.


I can always get back into Macintosh software development and use the 
site to sell my own apps -- that's an option I ponder whenever my 
clients don't call me for a week.


Who knows what may happen.

Cheers,

tedd

PS: I have over a dozen IDNS domains including the Pharmaceutical 
Icon, Yin-Yang Symbol, Sigma, Delta, and DOT dot com (option 8).


--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Convert UTF-8 to PHP defines

2010-05-28 Thread tedd

Bob wrtote:


The real question is whether unicode is even relevant now that the UTF
series is available.


Ashley answered:


Bob, UTF is unicode (Unicode Transformation Format)


Yes, Ashley is correct. UTF-8 is Unicode, as is UTF-16 and UTF-32, 
which all use different a number of bytes for each code point. Both 
UTF-8 and UTF-16 are variable length whereas UTF-32 is a fixed length 
of four bytes per code point.


As is my understanding, UTF-8 will accommodate all the languages 
(glyphs) of the world and then some. It will be a while before we 
need UTF-16 or UTF-32 but those are just a larger super-sets.


In any event, I always use UTF-8 in all my encoding.

Cheers,

tedd
--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Convert UTF-8 to PHP defines

2010-05-28 Thread Richard Quadling
On 28 May 2010 04:47, Guus Ellenkamp  wrote:
> And I need(ed) this stuff especially for non-ASCII characters like Chinese,
> Arabic and stuff :)
>
> "Ashley Sheridan"  wrote in message
> news:1274976794.2202.274.ca...@localhost...
> On Thu, 2010-05-27 at 12:08 -0400, Adam Richardson wrote:
>
>> On Thu, May 27, 2010 at 9:45 AM, Guus Ellenkamp
>> wrote:
>>
>> > Thanks, but are you sure of that? I did some research a while ago and
>> > found
>> > that officially PHP files should be ascii and not have any specific
>> > character encoding. I believe it will work anyhow (did not try this
>> > one),
>> > but would like to stick with the standards.
>> >
>> > "Ashley Sheridan"  wrote in message
>> > news:1274883714.2202.228.ca...@localhost...
>> > > On Wed, 2010-05-26 at 22:20 +0800, Guus Ellenkamp wrote:
>> > >
>> > >> We use PHP defines for defining text in different languages. As far
>> > >> as I
>> > >> know PHP files are supposed to be ASCII, not UTF-8 or something like
>> > >> that.
>> > >> What I want to make is a conversion program that would convert a
>> > >> given
>> > >> UTF-8
>> > >> file with the format
>> > >>
>> > >> definetext1=this is a text in random UTF-8, probably arabic or
>> > >> similar
>> > >> text
>> > >> definetext2=this is another text in random UTF-8, probably arabic or
>> > >> similar
>> > >> text
>> > >>
>> > >> into a file with the following defines
>> > >>
>> > >>
>> > define('definetext1',chr().chr().chr()...).chr());
>> > >>
>> > define('definetext2,chr().chr().chr()...).chr());
>> > >>
>> > >> Not sure if I'm using the correct chr/ord function, but I hope the
>> > >> above
>> > >> is
>> > >> clear enough to make clear what I'm looking for. Basically the output
>> > >> file
>> > >> should be ascii and not contain any utf-8.
>> > >>
>> > >> Any advise? The html_special_chars did not seem to work for
>> > >> Vietnamese
>> > >> text
>> > >> I tried to convert, so something seems to get wrong with just reading
>> > >> an
>> > >> array of strings and converting the strings and putting them in
>> > >> defines.
>> > >>
>> > >>
>> > >>
>> > >
>> > >
>> > > PHP files can contain utf-8, and in-fact is the preference of most
>> > > developers I know of.
>> > >
>> > > Thanks,
>> > > Ash
>> > > http://www.ashleysheridan.co.uk
>> > >
>> > >
>> > >
>> >
>> >
>> >
>> > --
>> > PHP General Mailing List (http://www.php.net/)
>> > To unsubscribe, visit: http://www.php.net/unsub.php
>> >
>> >
>> Because the lower range of UTF-8 matches the ascii character set
>> (intentionally by design), you'll be able to use UTF-8 for PHP files
>> without
>> problem (i.e., ascii 7-bit chars have same encoding in UTF-8.)
>> http://www.cl.cam.ac.uk/~mgk25/unicode.html
>>
>> However, if you were to use any of the multibyte characters of UTF-8 in a
>> PHP file, you could run in to some trouble.  I use UTF-8 for most of my
>> PHP
>> files, but I've been sticking to the ASCII subset exclusively.
>>
>> Adam
>>
>
>
> I don't use the higher range of characters often, but I do sometimes use
> them for things like the graphical glyphs (½??, etc) I know I could do
> those with regular text and the Wingdings font, but that's not available
> on every computer, and breaks the semantic meaning behind the glyphs.
>
> Thanks,
> Ash
> http://www.ashleysheridan.co.uk
>
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

Do you mean ...



If you cut and paste that into your editor, make sure that the font
you are using is a UTF-8 font. Otherwise you will see the font's
unknown symbol glyph rather than the correct ones.

If your font doesn't have the symbols, it doesn't affect the code. The
editor is only displaying the code. It doesn't alter the code.

Richard.



-- 
-
Richard Quadling
"Standing on the shoulders of some very clever giants!"
EE : http://www.experts-exchange.com/M_248814.html
EE4Free : http://www.experts-exchange.com/becomeAnExpert.jsp
Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731
ZOPA : http://uk.zopa.com/member/RQuadling

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Convert UTF-8 to PHP defines

2010-05-27 Thread Ashley Sheridan
On Fri, 2010-05-28 at 11:51 +0800, Guus Ellenkamp wrote:

> I would like if you stick to the original issue: can a PHP source file be in 
> utf-8. It's not about the output, that is properly supported.
> 
> Think it would be a good idea anyhow that PHP would support utf-8 source 
> files as it seems utf-8 is going to be the de-facto standard for text files 
> anyhow.
> 
> "Ashley Sheridan"  wrote in message 
> news:1274988834.2202.285.ca...@localhost...
> > On Thu, 2010-05-27 at 15:28 -0400, Bob McConnell wrote:
> >
> >> From: tedd
> >>
> >> > The Unicode database uses the same lower
> >> > character values (i.e., "code points") as does
> >> > ASCII, namely 0-127, and thus UFT-8 (8-bit
> >> > variable width encoding) is really a super-set
> >> > which includes the sub-set of ASCII.
> >> >
> >> > The "Wingdings" font that Ash refers to is the
> >> > really the "Dingbat" char set in Unicode, as
> >> > shown here:
> >> >
> >> > The use of UFT-8 encoding in everything (web and
> >> > php) should present much less problems globally
> >> > than it is trying to fight it.
> >>
> >> Thanks tedd,
> >>
> >> The real question is whether unicode is even relevant now that the UTF
> >> series is available. I see no reason to have to deal with two competing
> >> "specifications", when one of them is more than adequate for the job and
> >> the other is not even finished yet. That's like the old days when a few
> >> users demanded we support both ASCII and EBCDIC. That didn't get very
> >> far either.
> >>
> >> Bob McConnell
> >>
> >
> >
> > Bob, UTF is unicode (Unicode Transformation Format)
> >
> > Interesting enough to note, and not sure if Tedd knows this or not (he
> > probably does!) but Chrome has a nice feature for those punycode URLs;
> > it suggests the actual real URL instead once you type the domain in. Not
> > sure about Safari right now, couldn't be bothered to fire up a VM just
> > to check. I would assume Firefox handles these URLs well enough too.
> >
> > Tedd, does that URL actually go anywhere, as I got nothing when I tried
> > visiting it, both the actual URL and the punycode version.
> >
> > Thanks,
> > Ash
> > http://www.ashleysheridan.co.uk
> >
> >
> > 
> 
> 
> 


Yes is the quick answer.

There's no better way than to try it yourself.

Thanks,
Ash
http://www.ashleysheridan.co.uk




Re: [PHP] Convert UTF-8 to PHP defines

2010-05-27 Thread Guus Ellenkamp
I would like if you stick to the original issue: can a PHP source file be in 
utf-8. It's not about the output, that is properly supported.

Think it would be a good idea anyhow that PHP would support utf-8 source 
files as it seems utf-8 is going to be the de-facto standard for text files 
anyhow.

"Ashley Sheridan"  wrote in message 
news:1274988834.2202.285.ca...@localhost...
> On Thu, 2010-05-27 at 15:28 -0400, Bob McConnell wrote:
>
>> From: tedd
>>
>> > The Unicode database uses the same lower
>> > character values (i.e., "code points") as does
>> > ASCII, namely 0-127, and thus UFT-8 (8-bit
>> > variable width encoding) is really a super-set
>> > which includes the sub-set of ASCII.
>> >
>> > The "Wingdings" font that Ash refers to is the
>> > really the "Dingbat" char set in Unicode, as
>> > shown here:
>> >
>> > The use of UFT-8 encoding in everything (web and
>> > php) should present much less problems globally
>> > than it is trying to fight it.
>>
>> Thanks tedd,
>>
>> The real question is whether unicode is even relevant now that the UTF
>> series is available. I see no reason to have to deal with two competing
>> "specifications", when one of them is more than adequate for the job and
>> the other is not even finished yet. That's like the old days when a few
>> users demanded we support both ASCII and EBCDIC. That didn't get very
>> far either.
>>
>> Bob McConnell
>>
>
>
> Bob, UTF is unicode (Unicode Transformation Format)
>
> Interesting enough to note, and not sure if Tedd knows this or not (he
> probably does!) but Chrome has a nice feature for those punycode URLs;
> it suggests the actual real URL instead once you type the domain in. Not
> sure about Safari right now, couldn't be bothered to fire up a VM just
> to check. I would assume Firefox handles these URLs well enough too.
>
> Tedd, does that URL actually go anywhere, as I got nothing when I tried
> visiting it, both the actual URL and the punycode version.
>
> Thanks,
> Ash
> http://www.ashleysheridan.co.uk
>
>
> 



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Convert UTF-8 to PHP defines

2010-05-27 Thread Guus Ellenkamp
And I need(ed) this stuff especially for non-ASCII characters like Chinese, 
Arabic and stuff :)

"Ashley Sheridan"  wrote in message 
news:1274976794.2202.274.ca...@localhost...
On Thu, 2010-05-27 at 12:08 -0400, Adam Richardson wrote:

> On Thu, May 27, 2010 at 9:45 AM, Guus Ellenkamp
> wrote:
>
> > Thanks, but are you sure of that? I did some research a while ago and 
> > found
> > that officially PHP files should be ascii and not have any specific
> > character encoding. I believe it will work anyhow (did not try this 
> > one),
> > but would like to stick with the standards.
> >
> > "Ashley Sheridan"  wrote in message
> > news:1274883714.2202.228.ca...@localhost...
> > > On Wed, 2010-05-26 at 22:20 +0800, Guus Ellenkamp wrote:
> > >
> > >> We use PHP defines for defining text in different languages. As far 
> > >> as I
> > >> know PHP files are supposed to be ASCII, not UTF-8 or something like
> > >> that.
> > >> What I want to make is a conversion program that would convert a 
> > >> given
> > >> UTF-8
> > >> file with the format
> > >>
> > >> definetext1=this is a text in random UTF-8, probably arabic or 
> > >> similar
> > >> text
> > >> definetext2=this is another text in random UTF-8, probably arabic or
> > >> similar
> > >> text
> > >>
> > >> into a file with the following defines
> > >>
> > >>
> > define('definetext1',chr().chr().chr()...).chr());
> > >>
> > define('definetext2,chr().chr().chr()...).chr());
> > >>
> > >> Not sure if I'm using the correct chr/ord function, but I hope the 
> > >> above
> > >> is
> > >> clear enough to make clear what I'm looking for. Basically the output
> > >> file
> > >> should be ascii and not contain any utf-8.
> > >>
> > >> Any advise? The html_special_chars did not seem to work for 
> > >> Vietnamese
> > >> text
> > >> I tried to convert, so something seems to get wrong with just reading 
> > >> an
> > >> array of strings and converting the strings and putting them in 
> > >> defines.
> > >>
> > >>
> > >>
> > >
> > >
> > > PHP files can contain utf-8, and in-fact is the preference of most
> > > developers I know of.
> > >
> > > Thanks,
> > > Ash
> > > http://www.ashleysheridan.co.uk
> > >
> > >
> > >
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
> Because the lower range of UTF-8 matches the ascii character set
> (intentionally by design), you'll be able to use UTF-8 for PHP files 
> without
> problem (i.e., ascii 7-bit chars have same encoding in UTF-8.)
> http://www.cl.cam.ac.uk/~mgk25/unicode.html
>
> However, if you were to use any of the multibyte characters of UTF-8 in a
> PHP file, you could run in to some trouble.  I use UTF-8 for most of my 
> PHP
> files, but I've been sticking to the ASCII subset exclusively.
>
> Adam
>


I don't use the higher range of characters often, but I do sometimes use
them for things like the graphical glyphs (½??, etc) I know I could do
those with regular text and the Wingdings font, but that's not available
on every computer, and breaks the semantic meaning behind the glyphs.

Thanks,
Ash
http://www.ashleysheridan.co.uk





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Convert UTF-8 to PHP defines

2010-05-27 Thread Ashley Sheridan
On Thu, 2010-05-27 at 15:28 -0400, Bob McConnell wrote:

> From: tedd
> 
> > The Unicode database uses the same lower 
> > character values (i.e., "code points") as does 
> > ASCII, namely 0-127, and thus UFT-8 (8-bit 
> > variable width encoding) is really a super-set 
> > which includes the sub-set of ASCII.
> > 
> > The "Wingdings" font that Ash refers to is the 
> > really the "Dingbat" char set in Unicode, as 
> > shown here:
> > 
> > The use of UFT-8 encoding in everything (web and 
> > php) should present much less problems globally 
> > than it is trying to fight it.
> 
> Thanks tedd,
> 
> The real question is whether unicode is even relevant now that the UTF
> series is available. I see no reason to have to deal with two competing
> "specifications", when one of them is more than adequate for the job and
> the other is not even finished yet. That's like the old days when a few
> users demanded we support both ASCII and EBCDIC. That didn't get very
> far either.
> 
> Bob McConnell
> 


Bob, UTF is unicode (Unicode Transformation Format)

Interesting enough to note, and not sure if Tedd knows this or not (he
probably does!) but Chrome has a nice feature for those punycode URLs;
it suggests the actual real URL instead once you type the domain in. Not
sure about Safari right now, couldn't be bothered to fire up a VM just
to check. I would assume Firefox handles these URLs well enough too.

Tedd, does that URL actually go anywhere, as I got nothing when I tried
visiting it, both the actual URL and the punycode version.

Thanks,
Ash
http://www.ashleysheridan.co.uk




RE: [PHP] Convert UTF-8 to PHP defines

2010-05-27 Thread Bob McConnell
From: tedd

> The Unicode database uses the same lower 
> character values (i.e., "code points") as does 
> ASCII, namely 0-127, and thus UFT-8 (8-bit 
> variable width encoding) is really a super-set 
> which includes the sub-set of ASCII.
> 
> The "Wingdings" font that Ash refers to is the 
> really the "Dingbat" char set in Unicode, as 
> shown here:
> 
> The use of UFT-8 encoding in everything (web and 
> php) should present much less problems globally 
> than it is trying to fight it.

Thanks tedd,

The real question is whether unicode is even relevant now that the UTF
series is available. I see no reason to have to deal with two competing
"specifications", when one of them is more than adequate for the job and
the other is not even finished yet. That's like the old days when a few
users demanded we support both ASCII and EBCDIC. That didn't get very
far either.

Bob McConnell

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Convert UTF-8 to PHP defines

2010-05-27 Thread tedd

At 7:11 PM +0100 5/27/10, Ashley Sheridan wrote:

On Thu, 2010-05-27 at 14:06 -0400, Bob McConnell wrote:
 > From: Ashley Sheridan
 > > I don't use the higher range of characters often, but I do sometimes use

 > them for things like the graphical glyphs (1Ž2)&, etc) I know I could do
 > those with regular text and the Wingdings font, but that's not available
 > on every computer, and breaks the semantic meaning behind the glyphs.

 What higher range? ASCII only defined 128 
values, the bottom 32 being control characters 
that don't print. Anything outside of that is 
not ASCII, but a proprietary extension. In 
particular, the glyphs usually associated with 
0-32 and 128-255 are IBM specific and not 
guaranteed to be present outside of their 
original video ROM. So only the first 128 
characters map directly into UTF-8.


 Bob McConnell

 Ref: pp 25-29 The Programmer's PC Sourcebook, 
1988, Thom Hogan, Microsoft Press



The higher range of utf8 characters that don't map to ascii values.

Thanks,
Ash


Bob:

I understood what Ash was referring re his 
"higher range" statement, but his second 
statement was somewhat confusing.


ASCII is defined as characters having a value of 
0-127 DEC (00-7F HEX). The "higher range" of 
128-255 DEC (80-FF HEX) have been loosely 
characterized as "extended ASCII" but have not 
been officially declared such. Both M$ and Apple 
have their own characters appearing the range and 
have used different character for different 
things -- thus problems arose is using either. I 
do not know if the problem was ever resolved. 
It's probably best to never use such characters.


The Unicode database uses the same lower 
character values (i.e., "code points") as does 
ASCII, namely 0-127, and thus UFT-8 (8-bit 
variable width encoding) is really a super-set 
which includes the sub-set of ASCII.


The "Wingdings" font that Ash refers to is the 
really the "Dingbat" char set in Unicode, as 
shown here:


http://www.unicode.org/charts/PDF/U2700.pdf

These are real characters that can be used for 
all sorts of things including url's, for example:


http://xn--gci.com

Please forgive the PUNYCODE url, but IE does not 
recognize "other than ASCII" characters in url's, 
whereas Safari will show the url correctly. 
Clearly, Safari has the upper hand in resolving 
"other than English" issues -- perhaps that's why 
their overseas profits last year exceeded their 
domestic -- but I digress.


The use of UFT-8 encoding in everything (web and 
php) should present much less problems globally 
than it is trying to fight it.


Here's some references that may help:

[1] 
[2] 
[3] 
[4] 
[5] 
[6] 

Cheers,

tedd

--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Convert UTF-8 to PHP defines

2010-05-27 Thread Ashley Sheridan
On Thu, 2010-05-27 at 14:06 -0400, Bob McConnell wrote:

> From: Ashley Sheridan
> 
> >On Thu, 2010-05-27 at 12:08 -0400, Adam Richardson wrote:
> >
> >> On Thu, May 27, 2010 at 9:45 AM, Guus Ellenkamp
> >> wrote:
> >> 
> >> > Thanks, but are you sure of that? I did some research a while ago and 
> >> > found
> >> > that officially PHP files should be ascii and not have any specific
> >> > character encoding. I believe it will work anyhow (did not try this one),
> >> > but would like to stick with the standards.
> >> >
> >> > "Ashley Sheridan"  wrote in message
> >> > news:1274883714.2202.228.ca...@localhost...
> >> > > On Wed, 2010-05-26 at 22:20 +0800, Guus Ellenkamp wrote:
> >> > >
> >> > >> We use PHP defines for defining text in different languages. As far 
> >> > >> as I
> >> > >> know PHP files are supposed to be ASCII, not UTF-8 or something like
> >> > >> that.
> >> > >> What I want to make is a conversion program that would convert a given
> >> > >> UTF-8
> >> > >> file with the format
> >> > >>
> >> > >> definetext1=this is a text in random UTF-8, probably arabic or similar
> >> > >> text
> >> > >> definetext2=this is another text in random UTF-8, probably arabic or
> >> > >> similar
> >> > >> text
> >> > >>
> >> > >> into a file with the following defines
> >> > >>
> >> > >>
> >> > define('definetext1',chr().chr().chr()...
> > ).chr());
> >> > >>
> >> > define('definetext2,chr().chr().chr()...
> > ).chr());
> >> > >>
> >> > >> Not sure if I'm using the correct chr/ord function, but I hope the 
> >> > >> above
> >> > >> is
> >> > >> clear enough to make clear what I'm looking for. Basically the output
> >> > >> file
> >> > >> should be ascii and not contain any utf-8.
> >> > >>
> >> > >> Any advise? The html_special_chars did not seem to work for Vietnamese
> >> > >> text
> >> > >> I tried to convert, so something seems to get wrong with just reading 
> >> > >> an
> >> > >> array of strings and converting the strings and putting them in 
> >> > >> defines.
> >> > >
> >> > > PHP files can contain utf-8, and in-fact is the preference of most
> >> > > developers I know of.
> >> > >
> >> >
> >> Because the lower range of UTF-8 matches the ascii character set
> >> (intentionally by design), you'll be able to use UTF-8 for PHP files 
> >> without
> >> problem (i.e., ascii 7-bit chars have same encoding in UTF-8.)
> >> http://www.cl.cam.ac.uk/~mgk25/unicode.html
> >> 
> >> However, if you were to use any of the multibyte characters of UTF-8 in a
> >> PHP file, you could run in to some trouble.  I use UTF-8 for most of my PHP
> >> files, but I've been sticking to the ASCII subset exclusively.
> >
> > I don't use the higher range of characters often, but I do sometimes use
> > them for things like the graphical glyphs (½✉✆, etc) I know I could do
> > those with regular text and the Wingdings font, but that's not available
> > on every computer, and breaks the semantic meaning behind the glyphs.
> 
> What higher range? ASCII only defined 128 values, the bottom 32 being control 
> characters that don't print. Anything outside of that is not ASCII, but a 
> proprietary extension. In particular, the glyphs usually associated with 0-32 
> and 128-255 are IBM specific and not guaranteed to be present outside of 
> their original video ROM. So only the first 128 characters map directly into 
> UTF-8.
> 
> Bob McConnell
> 
> Ref: pp 25-29 The Programmer's PC Sourcebook, 1988, Thom Hogan, Microsoft 
> Press


The higher range of utf8 characters that don't map to ascii values.

Thanks,
Ash
http://www.ashleysheridan.co.uk




RE: [PHP] Convert UTF-8 to PHP defines

2010-05-27 Thread Bob McConnell
From: Ashley Sheridan

>On Thu, 2010-05-27 at 12:08 -0400, Adam Richardson wrote:
>
>> On Thu, May 27, 2010 at 9:45 AM, Guus Ellenkamp
>> wrote:
>> 
>> > Thanks, but are you sure of that? I did some research a while ago and found
>> > that officially PHP files should be ascii and not have any specific
>> > character encoding. I believe it will work anyhow (did not try this one),
>> > but would like to stick with the standards.
>> >
>> > "Ashley Sheridan"  wrote in message
>> > news:1274883714.2202.228.ca...@localhost...
>> > > On Wed, 2010-05-26 at 22:20 +0800, Guus Ellenkamp wrote:
>> > >
>> > >> We use PHP defines for defining text in different languages. As far as I
>> > >> know PHP files are supposed to be ASCII, not UTF-8 or something like
>> > >> that.
>> > >> What I want to make is a conversion program that would convert a given
>> > >> UTF-8
>> > >> file with the format
>> > >>
>> > >> definetext1=this is a text in random UTF-8, probably arabic or similar
>> > >> text
>> > >> definetext2=this is another text in random UTF-8, probably arabic or
>> > >> similar
>> > >> text
>> > >>
>> > >> into a file with the following defines
>> > >>
>> > >>
>> > define('definetext1',chr().chr().chr()...
> ).chr());
>> > >>
>> > define('definetext2,chr().chr().chr()...
> ).chr());
>> > >>
>> > >> Not sure if I'm using the correct chr/ord function, but I hope the above
>> > >> is
>> > >> clear enough to make clear what I'm looking for. Basically the output
>> > >> file
>> > >> should be ascii and not contain any utf-8.
>> > >>
>> > >> Any advise? The html_special_chars did not seem to work for Vietnamese
>> > >> text
>> > >> I tried to convert, so something seems to get wrong with just reading an
>> > >> array of strings and converting the strings and putting them in defines.
>> > >
>> > > PHP files can contain utf-8, and in-fact is the preference of most
>> > > developers I know of.
>> > >
>> >
>> Because the lower range of UTF-8 matches the ascii character set
>> (intentionally by design), you'll be able to use UTF-8 for PHP files without
>> problem (i.e., ascii 7-bit chars have same encoding in UTF-8.)
>> http://www.cl.cam.ac.uk/~mgk25/unicode.html
>> 
>> However, if you were to use any of the multibyte characters of UTF-8 in a
>> PHP file, you could run in to some trouble.  I use UTF-8 for most of my PHP
>> files, but I've been sticking to the ASCII subset exclusively.
>
> I don't use the higher range of characters often, but I do sometimes use
> them for things like the graphical glyphs (½✉✆, etc) I know I could do
> those with regular text and the Wingdings font, but that's not available
> on every computer, and breaks the semantic meaning behind the glyphs.

What higher range? ASCII only defined 128 values, the bottom 32 being control 
characters that don't print. Anything outside of that is not ASCII, but a 
proprietary extension. In particular, the glyphs usually associated with 0-32 
and 128-255 are IBM specific and not guaranteed to be present outside of their 
original video ROM. So only the first 128 characters map directly into UTF-8.

Bob McConnell

Ref: pp 25-29 The Programmer's PC Sourcebook, 1988, Thom Hogan, Microsoft Press


Re: [PHP] Convert UTF-8 to PHP defines

2010-05-27 Thread tedd

At 5:13 PM +0100 5/27/10, Ashley Sheridan wrote:


I don't use the higher range of characters often, but I do sometimes use
them for things like the graphical glyphs (1Ž2)&, etc) I know I could do
those with regular text and the Wingdings font, but that's not available
on every computer, and breaks the semantic meaning behind the glyphs.

Thanks,
Ash



Ash:

I read briefly on the css discuss list there is a 
movement to "force" download of fonts (i.e., char 
sets) to make layouts work. Apparently some 
browsers allow for that but I have not read up on 
it and I may have the wrong impression, but that 
was my take.


For the exception of "evil" fonts, it seemed like a good idea.

Cheers,

tedd
--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Convert UTF-8 to PHP defines

2010-05-27 Thread Ashley Sheridan
On Thu, 2010-05-27 at 12:08 -0400, Adam Richardson wrote:

> On Thu, May 27, 2010 at 9:45 AM, Guus Ellenkamp
> wrote:
> 
> > Thanks, but are you sure of that? I did some research a while ago and found
> > that officially PHP files should be ascii and not have any specific
> > character encoding. I believe it will work anyhow (did not try this one),
> > but would like to stick with the standards.
> >
> > "Ashley Sheridan"  wrote in message
> > news:1274883714.2202.228.ca...@localhost...
> > > On Wed, 2010-05-26 at 22:20 +0800, Guus Ellenkamp wrote:
> > >
> > >> We use PHP defines for defining text in different languages. As far as I
> > >> know PHP files are supposed to be ASCII, not UTF-8 or something like
> > >> that.
> > >> What I want to make is a conversion program that would convert a given
> > >> UTF-8
> > >> file with the format
> > >>
> > >> definetext1=this is a text in random UTF-8, probably arabic or similar
> > >> text
> > >> definetext2=this is another text in random UTF-8, probably arabic or
> > >> similar
> > >> text
> > >>
> > >> into a file with the following defines
> > >>
> > >>
> > define('definetext1',chr().chr().chr()...).chr());
> > >>
> > define('definetext2,chr().chr().chr()...).chr());
> > >>
> > >> Not sure if I'm using the correct chr/ord function, but I hope the above
> > >> is
> > >> clear enough to make clear what I'm looking for. Basically the output
> > >> file
> > >> should be ascii and not contain any utf-8.
> > >>
> > >> Any advise? The html_special_chars did not seem to work for Vietnamese
> > >> text
> > >> I tried to convert, so something seems to get wrong with just reading an
> > >> array of strings and converting the strings and putting them in defines.
> > >>
> > >>
> > >>
> > >
> > >
> > > PHP files can contain utf-8, and in-fact is the preference of most
> > > developers I know of.
> > >
> > > Thanks,
> > > Ash
> > > http://www.ashleysheridan.co.uk
> > >
> > >
> > >
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
> Because the lower range of UTF-8 matches the ascii character set
> (intentionally by design), you'll be able to use UTF-8 for PHP files without
> problem (i.e., ascii 7-bit chars have same encoding in UTF-8.)
> http://www.cl.cam.ac.uk/~mgk25/unicode.html
> 
> However, if you were to use any of the multibyte characters of UTF-8 in a
> PHP file, you could run in to some trouble.  I use UTF-8 for most of my PHP
> files, but I've been sticking to the ASCII subset exclusively.
> 
> Adam
> 


I don't use the higher range of characters often, but I do sometimes use
them for things like the graphical glyphs (½✉✆, etc) I know I could do
those with regular text and the Wingdings font, but that's not available
on every computer, and breaks the semantic meaning behind the glyphs.

Thanks,
Ash
http://www.ashleysheridan.co.uk




Re: [PHP] Convert UTF-8 to PHP defines

2010-05-27 Thread Adam Richardson
On Thu, May 27, 2010 at 9:45 AM, Guus Ellenkamp
wrote:

> Thanks, but are you sure of that? I did some research a while ago and found
> that officially PHP files should be ascii and not have any specific
> character encoding. I believe it will work anyhow (did not try this one),
> but would like to stick with the standards.
>
> "Ashley Sheridan"  wrote in message
> news:1274883714.2202.228.ca...@localhost...
> > On Wed, 2010-05-26 at 22:20 +0800, Guus Ellenkamp wrote:
> >
> >> We use PHP defines for defining text in different languages. As far as I
> >> know PHP files are supposed to be ASCII, not UTF-8 or something like
> >> that.
> >> What I want to make is a conversion program that would convert a given
> >> UTF-8
> >> file with the format
> >>
> >> definetext1=this is a text in random UTF-8, probably arabic or similar
> >> text
> >> definetext2=this is another text in random UTF-8, probably arabic or
> >> similar
> >> text
> >>
> >> into a file with the following defines
> >>
> >>
> define('definetext1',chr().chr().chr()...).chr());
> >>
> define('definetext2,chr().chr().chr()...).chr());
> >>
> >> Not sure if I'm using the correct chr/ord function, but I hope the above
> >> is
> >> clear enough to make clear what I'm looking for. Basically the output
> >> file
> >> should be ascii and not contain any utf-8.
> >>
> >> Any advise? The html_special_chars did not seem to work for Vietnamese
> >> text
> >> I tried to convert, so something seems to get wrong with just reading an
> >> array of strings and converting the strings and putting them in defines.
> >>
> >>
> >>
> >
> >
> > PHP files can contain utf-8, and in-fact is the preference of most
> > developers I know of.
> >
> > Thanks,
> > Ash
> > http://www.ashleysheridan.co.uk
> >
> >
> >
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
Because the lower range of UTF-8 matches the ascii character set
(intentionally by design), you'll be able to use UTF-8 for PHP files without
problem (i.e., ascii 7-bit chars have same encoding in UTF-8.)
http://www.cl.cam.ac.uk/~mgk25/unicode.html

However, if you were to use any of the multibyte characters of UTF-8 in a
PHP file, you could run in to some trouble.  I use UTF-8 for most of my PHP
files, but I've been sticking to the ASCII subset exclusively.

Adam

-- 
Nephtali:  PHP web framework that functions beautifully
http://nephtaliproject.com


Re: [PHP] Convert UTF-8 to PHP defines

2010-05-27 Thread Ashley Sheridan
On Thu, 2010-05-27 at 21:45 +0800, Guus Ellenkamp wrote:

> Thanks, but are you sure of that? I did some research a while ago and found 
> that officially PHP files should be ascii and not have any specific 
> character encoding. I believe it will work anyhow (did not try this one), 
> but would like to stick with the standards.
> 
> "Ashley Sheridan"  wrote in message 
> news:1274883714.2202.228.ca...@localhost...
> > On Wed, 2010-05-26 at 22:20 +0800, Guus Ellenkamp wrote:
> >
> >> We use PHP defines for defining text in different languages. As far as I
> >> know PHP files are supposed to be ASCII, not UTF-8 or something like 
> >> that.
> >> What I want to make is a conversion program that would convert a given 
> >> UTF-8
> >> file with the format
> >>
> >> definetext1=this is a text in random UTF-8, probably arabic or similar 
> >> text
> >> definetext2=this is another text in random UTF-8, probably arabic or 
> >> similar
> >> text
> >>
> >> into a file with the following defines
> >>
> >> define('definetext1',chr().chr().chr()...).chr());
> >> define('definetext2,chr().chr().chr()...).chr());
> >>
> >> Not sure if I'm using the correct chr/ord function, but I hope the above 
> >> is
> >> clear enough to make clear what I'm looking for. Basically the output 
> >> file
> >> should be ascii and not contain any utf-8.
> >>
> >> Any advise? The html_special_chars did not seem to work for Vietnamese 
> >> text
> >> I tried to convert, so something seems to get wrong with just reading an
> >> array of strings and converting the strings and putting them in defines.
> >>
> >>
> >>
> >
> >
> > PHP files can contain utf-8, and in-fact is the preference of most
> > developers I know of.
> >
> > Thanks,
> > Ash
> > http://www.ashleysheridan.co.uk
> >
> >
> > 
> 
> 
> 


Very sure, ever PHP file I ever make is always in utf8. The only problem
you might encounter is when outputting HTML, you should make sure that
you output the right text encoding headers, as some browsers won't
correctly detect it and can tend to output utf-8 characters as random
blocks and other characters.

Thanks,
Ash
http://www.ashleysheridan.co.uk




Re: [PHP] Convert UTF-8 to PHP defines

2010-05-27 Thread Guus Ellenkamp
Thanks, but are you sure of that? I did some research a while ago and found 
that officially PHP files should be ascii and not have any specific 
character encoding. I believe it will work anyhow (did not try this one), 
but would like to stick with the standards.

"Ashley Sheridan"  wrote in message 
news:1274883714.2202.228.ca...@localhost...
> On Wed, 2010-05-26 at 22:20 +0800, Guus Ellenkamp wrote:
>
>> We use PHP defines for defining text in different languages. As far as I
>> know PHP files are supposed to be ASCII, not UTF-8 or something like 
>> that.
>> What I want to make is a conversion program that would convert a given 
>> UTF-8
>> file with the format
>>
>> definetext1=this is a text in random UTF-8, probably arabic or similar 
>> text
>> definetext2=this is another text in random UTF-8, probably arabic or 
>> similar
>> text
>>
>> into a file with the following defines
>>
>> define('definetext1',chr().chr().chr()...).chr());
>> define('definetext2,chr().chr().chr()...).chr());
>>
>> Not sure if I'm using the correct chr/ord function, but I hope the above 
>> is
>> clear enough to make clear what I'm looking for. Basically the output 
>> file
>> should be ascii and not contain any utf-8.
>>
>> Any advise? The html_special_chars did not seem to work for Vietnamese 
>> text
>> I tried to convert, so something seems to get wrong with just reading an
>> array of strings and converting the strings and putting them in defines.
>>
>>
>>
>
>
> PHP files can contain utf-8, and in-fact is the preference of most
> developers I know of.
>
> Thanks,
> Ash
> http://www.ashleysheridan.co.uk
>
>
> 



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Convert UTF-8 to PHP defines

2010-05-27 Thread Andre Polykanine
Hello Guus,

Actually, we are using the same method here on http://oire.org/. We
have all of the language files in UTF8 format and everything seems to
be OK. Yes, unicode support in PHp laisse à désirer, like the French
say, but it does support UTF8 files.
-- 
With best regards from Ukraine,
Andre
Skype: Francophile; Wlm&MSN: arthaelon @ yandex.ru; Jabber: arthaelon @ 
jabber.org
Yahoo! messenger: andre.polykanine; ICQ: 191749952
Twitter: m_elensule

- Original message -
From: Guus Ellenkamp 
To: php-general@lists.php.net 
Date: Wednesday, May 26, 2010, 5:20:59 PM
Subject: [PHP] Convert UTF-8 to PHP defines

We use PHP defines for defining text in different languages. As far as I 
know PHP files are supposed to be ASCII, not UTF-8 or something like that. 
What I want to make is a conversion program that would convert a given UTF-8 
file with the format

definetext1=this is a text in random UTF-8, probably arabic or similar text
definetext2=this is another text in random UTF-8, probably arabic or similar 
text

into a file with the following defines

define('definetext1',chr().chr().chr()...).chr());
define('definetext2,chr().chr().chr()...).chr());

Not sure if I'm using the correct chr/ord function, but I hope the above is 
clear enough to make clear what I'm looking for. Basically the output file 
should be ascii and not contain any utf-8.

Any advise? The html_special_chars did not seem to work for Vietnamese text 
I tried to convert, so something seems to get wrong with just reading an 
array of strings and converting the strings and putting them in defines. 



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Convert UTF-8 to PHP defines

2010-05-26 Thread Ashley Sheridan
On Wed, 2010-05-26 at 22:20 +0800, Guus Ellenkamp wrote:

> We use PHP defines for defining text in different languages. As far as I 
> know PHP files are supposed to be ASCII, not UTF-8 or something like that. 
> What I want to make is a conversion program that would convert a given UTF-8 
> file with the format
> 
> definetext1=this is a text in random UTF-8, probably arabic or similar text
> definetext2=this is another text in random UTF-8, probably arabic or similar 
> text
> 
> into a file with the following defines
> 
> define('definetext1',chr().chr().chr()...).chr());
> define('definetext2,chr().chr().chr()...).chr());
> 
> Not sure if I'm using the correct chr/ord function, but I hope the above is 
> clear enough to make clear what I'm looking for. Basically the output file 
> should be ascii and not contain any utf-8.
> 
> Any advise? The html_special_chars did not seem to work for Vietnamese text 
> I tried to convert, so something seems to get wrong with just reading an 
> array of strings and converting the strings and putting them in defines. 
> 
> 
> 


PHP files can contain utf-8, and in-fact is the preference of most
developers I know of.

Thanks,
Ash
http://www.ashleysheridan.co.uk