Archive for October, 2009

Ajax posting and escape for unicode characters

Posted on October 30, 2009
1 Comment


Unicode characters can be quite troublesome sometimes, and will be even complicated with ajax posting.
Well, at least that’s what I face today, I need to post a form with unicode characters inside. If you are familiar with Ajax posting, then you should know javascript function named “escape()“.

Usually, for Ajax posting, I can just do “escape()” in Javascript to encode unwanted characters like “&” , ” “, “+”, “=“, and many others. But today I found out that “escape()” will not work for Unicode characters.
For example, it will encode (a single quote usually found in Microsoft Word) to u2019, and this is not good for me, as my application is a CMS, and it deals with web content and usually people just copy paste the content from Microsoft Word.

After I browse around, I found a Javascript function to escape unwanted characters, and is safe for Unicode also, the function is “encodeURIComponent“. So I directly do a Replace All for escape function to encodeURIComponent, and so far it works like a charm! ^^

Here you can see how the various JavaScript and PHP functions apply to a range of common characters.

Input JavaScript PHP
escape encodeURI encodeURIComponent urlencode rawurlencode htmlentities
<space> %20 %20 %20 + %20
! %21 ! ! %21 %21 !
@ @ @ %40 %40 %40 @
# %23 # %23 %23 %23 #
$ %24 $ %24 %24 %24 $
% %25 %25 %25 %25 %25 %
^ %5E %5E %5E %5E %5E ^
& %26 & %26 %26 %26 &amp;
* * * * %2A %2A *
( %28 ( ( %28 %28 (
) %29 ) ) %29 %29 )
- - - - - - -
_ _ _ _ _ _ _
= %3D = %3D %3D %3D =
+ + + %2B %2B %2B +
: %3A : %3A %3A %3A :
; %3B ; %3B %3B %3B; ;
. . . . . . .
%22 %22 %22 %22 %22 &quot;
%27 %27 %27
\ %5C %5C %5C %5C %5C \
/ / / %2F %2F %2F /
? %3F ? %3F %3F %3F ?
< %3C %3C %3C %3C %3C &lt;
> %3E %3E %3E %3E %3E &gt;
~ %7E ~ ~ %7E %7E ~
[ %5B %5B %5B %5B %5B [
] %5D %5D %5D %5D %5D ]
{ %7B %7B %7B %7B %7B {
} %7D %7D %7D %7D %7D }
` %60 %60 %60 %60 %60 `
before u give up, ask Google!

Tags: , , , ,

stick to the decision

Posted on October 29, 2009
3 Comments


Grrr… I would like to brag about today!!! !@#$%^&*()
Today I do FEEL a LOT, it’s fascinating how I can feel different types of emotions within this single day, ANGER, FEAR, ANXIOUS, WORRY, PAIN, SAD, HAPPY, HATE. In a way, this is a good sign, showing that I am 100% human capable of emotion, but I really don’t mind if I skip them all except for the HAPPY one.
Enough about emotion, now back to decision, I make two or more decision some time ago, and things have been okay until lately. Lately, I need to force myself to know that I’ve made the right decision, that it’s for the best, and that I need to stick to that decision and do it happily, with enthusiastic spirit, not grumbling and resentment. Grrr, at times I really just feel like quitting, and don’t care about responsibilities, just do what I want, when I want. At times like these, I find it hard to be positive, but thanks God, I still think and know what’s the right thing to do. Hff..

Okay, last night I read Nehemiah 8:1-18, and verse 10 really struck and strengthen me! it says, “.. Do not grieve, for the Joy of the LORD is your strength!!!”. And this verse close my day last night, it really strengthen me, and gives me serenity for the day! Thanks God for listening and being real to me! :-D

sometimes, to continue living takes more courage than dead

Tags: , , , , , ,

My Redeemer Lives – Nicole C. Mullins

Posted on October 27, 2009
No Comments

INTRO:  G / C / D

            	G	     C		 D
Who taught the sun where to stand in the morning?
	     G	           C		  D
Who told the ocean you can only come this far?
C	       B			C
Who showed the moon where to hide 'til evening?
G			C		D
Whose words alone can catch a falling star? 

	  G	  C	   D
Well I know my Redeemer lives
     C		B      C
I know my Redeemer lives
		    D
All of creation testify
    B		   C
His life within me cries
            D      G	   / C / D
I know my Redeemer lives

	      G	       C		D
The very same God that spins things in orbit
		G	   C		D
He runs to the weary, the worn and the weak
	C	     B				C
And the same gentle hands that hold me when I'm broken
     G			C	      D
They conquered death to bring me victory

      G	        C	 D
Now I know my Redeemer lives
  C	    B	    C
I know my Redeemer lives
		      D
Let all creation testify
	 B		C
Let this life within me cry
	    D	       G
I know my Redeemer, He lives ...

   C		D
To take away my shame
	 Em     C	       D
And He lives forever, I'll proclaim
	 B		C
That the payment for my sin
	B		  C
Was the precious life He gave
	 G
But now He's alive and
C		   D	 (Chord shift)  D / E
There's an empty grave!

	A	D	E
Now I know my Redeemer lives
  D         C#	   D
I know my Redeemer lives
		       E
Let all creation testify
	 C#		D
Let this life within me cry
     D	    E	       A
I know my Redeemer, He lives

     A      D	       E
I know my Redeemer, He live
(Repeating last line .....)

You are my world

Posted on October 23, 2009
No Comments

You Are My World 

Intro: |Em7 |C2 |G |D/F#

Verse 1:
Em7
My Father I adore you more than
C2
Anything my heart could wish for
G              D/F#
I just want you
Em7
And Jesus my beloved Saviour
C2                                    G
Everything I have I owe to You
                    D/F#
I owe it all to you
Am7   C2           Dsus4 D
And angels come and adore You
Am7       C2         Dsus4 D
And we Your children worship You

Chorus:                                                 G
You are my world,
            D
You are my God
C                       D
and I lay down my life for You
           G
You are my Lord
              D
The one I love
C                  Cm6
No one could ever take your place
Verse 2:
Em7
And everything I have I give to You my Lord
C2
the One I live for
G         D/F#
I live for You
Em7
All my days are gifts from You I pray I’d use
C2                   G
them as You want me to
                    D/F#
Use them for You