php-general Digest 28 May 2010 16:35:05 -0000 Issue 6769

Topics (messages 305605 through 305610):

Re: Convert UTF-8 to PHP defines
        305605 by: Guus Ellenkamp
        305606 by: Ashley Sheridan
        305607 by: Richard Quadling
        305608 by: tedd
        305609 by: tedd

Re: Select Values Didn't Get Passed in From Two Different Forms
        305610 by: tedd

Administrivia:

To subscribe to the digest, e-mail:
        php-general-digest-subscr...@lists.php.net

To unsubscribe from the digest, e-mail:
        php-general-digest-unsubscr...@lists.php.net

To post to the list, e-mail:
        php-gene...@lists.php.net


----------------------------------------------------------------------
--- Begin Message ---
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" <a...@ashleysheridan.co.uk> 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
>
>
> 



--- End Message ---
--- Begin Message ---
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" <a...@ashleysheridan.co.uk> 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



--- End Message ---
--- Begin Message ---
On 28 May 2010 04:47, Guus Ellenkamp <ellenkamp_g...@hotmail.com> wrote:
> And I need(ed) this stuff especially for non-ASCII characters like Chinese,
> Arabic and stuff :)
>
> "Ashley Sheridan" <a...@ashleysheridan.co.uk> 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
>> <ellenkamp_g...@hotmail.com>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" <a...@ashleysheridan.co.uk> 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(<t_value>).chr(<h_value>).chr(<i_value>)...<chr(<x_value>).chr(<t_value>));
>> > >>
>> > define('definetext2,chr(<t_value>).chr(<h_value>).chr(<i_value>)...<chr(<x_value>).chr(<t_value>));
>> > >>
>> > >> 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 ...

<?php
echo '早晨好';
?>

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

--- End Message ---
--- Begin Message ---
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

--- End Message ---
--- Begin Message ---
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

--- End Message ---
--- Begin Message ---
At 9:19 PM -0400 5/27/10, Alice Wei wrote:

I am not sure how to add to the page you have set up, but here is the code with ther portion you have set up:


<?php
  $start = isset($_POST['start']) ? $_POST['start'] : null;
?>
    <form action="" method="post">
      <p>
        Select the type of your starting point of interest:<br>
<input type="text" name="start" value="<?php echo($start);?>" size="20" ><br />
        Which Semster is this: <select name="semester">
                        <option value="Fall">Fall</option>
                        <option value="Spring">Spring</option>
                        <option value="Summer">Summer</option>
                    </select><br/>
        <input type="submit" name="submit" value="Submit" >
      </p>
    </form>

 Note, what I provided here does not include anything on the ajax.

Hope this answers your question.

Alice :

I didn't have a question, but here's my revision of your code:

http://www.webbytedd.com/cccc/alice1/

Please review the code and see how: 1) I captured the select value; 2) and how I used that value to focus the selected option.

You say:

 Note, what I provided here does not include anything on the ajax.

I've never put anything "on the ajax" -- that doesn't make sense.

Ajax is simply a way to communicate from the browser to the server and back again without requiring a browser refresh. As the user triggers a client-side event (i.e., click, select, enter text, move a mouse, whatever), a javascript routine then sends data to the server to activate a server-side script, which may, or may not, return data.

For example -- with javascript turned ON please review:

http://www.webbytedd.com/a/ajax-site/

This is simply a one page template that uses an ajax routine to retrieve data from the server to populate the page based upon what the user triggers (i.e., the visitor clicks a navigational link).

If you will review the HTML source code, you will find a very basic HTML template that will remain static for all three "apparent" pages. If you use the FireFox browser you can review the generated HTML.

Now where did the generated HTML come from, you might ask? It came from the server after a request was made from the client to the server and the server responded with the correct data -- all without requiring a browser refresh. That's an example of how ajax works.

Keep in mind that using "best practices" requires you to *first* design forms to collect data WITHOUT requiring javascript and then you can enhance the form to provide additional functionality to those who have javascript turned on. Also keep in mind that you may not need ajax to alter the form. You only need ajax if there is data on the server that needs to be retrieved.

Now, please turn javascript OFF in your browser and review my page again:

http://www.webbytedd.com/a/ajax-site/

That's an example of NOT following "best practices". The visitor is provided nothing if they have javascript turned OFF.

Now considering such, what additional functionality do you want your form to do that can't be done already?

Cheers,

tedd

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

--- End Message ---

Reply via email to