jump to navigation

PHP: Working with Japanese Text April 19, 2008

Posted by bluejay002 in PHP.
Tags: , , , , , , , , , , , , ,
add a comment

Unlike English text, Japanese text behaves differently. It is because Japanese characters itself is a combination of other Japanese characters. This case we call them mutlibyte, unlike English characters which are stored in a single byte.

I have been troubled the first time I got to make a website which needs to handle Japanese characters, both input and output. To make things easier, I will have let you see this checklist when working Japanese Text:

Choose which collation you are going to use
There are several collations that you can choose from. I will suggest two:
1. UTF-8
2. Shift_JIS
These are the commonly used collations.

If you plan to make websites that would handle Japanese text (with some English text on it), then Shift_JIS would do. It has a large collection of Kanji that you can work with (Check other Japanese websites, they usually use Shift_JIS). Also, with Shift_JIS, you can easily translate it with no problem at all to UTF-8.

If you plan on making a website that would later cater other multibyte characters as well (e.g., Chinese), then UTF-8 would be better. UTF-8 got a rich collection of kanji but changing to a different collation would make some of your characters unreadeable (since some cannot be translated perfectly).

Configure you IDE in accordance with the collation you are going to use
I have encountered problems before when I tried using Shift-JIS as the default charset and I tried saving it in UTF-8 format. It did not display characters correctly.

Specify the charset in your website
You can specify the charset of your website at the meta tag inside the head tag:

<meta http-equiv="Content-Type" content="text/html; charset=shift_jis" />

Set the collation in your website
To save your data as how it should be, the database should have the same collation with your charset. otherwise, you need to change literally change the encoding in PHP which would take some time during translation, its not really that long though.

If this is the case, use mb_convert_encoding() function in PHP. This is really handy when an existing database is already set with critical information, though in this manner you cannot expect to work perfectly in all cases.

That’s it! Wit this you should be ready to make website in Japanese, the rest will rely to your skills.

If you find this helpful, or if you have comments, suggestion, corrections or additions, I would really appreciate if you would drop some comments.

Happy programming! God bless!

Summer in here! April 18, 2008

Posted by Sakura in Life and Inspirations.
Tags:
add a comment

Blog Rank April 15, 2008

Posted by Sakura in Techie Updates.
Tags: , ,
add a comment

Evolution of technology gets even higher. As the world wide web increases its demand, it invades the most and common senses of all human being. It gives an alternative way in living the works more easier and interactive.

For the fast development, almost all computer users do blogging. Having a dairy and/or journals in a usual way that is done on a notebooks or commercial dairy notes. Here’s an alternative and most recommended way on doing those self stories, opinions and sharing views online. Even when you want it publicized or suppressed, still like in a natural dairy you can be able to manage it in a way you wanted.

The world of blogosphere looms for just a period of time. As everyone is writing their thoughts online, discussing series of articles online and sharing views online, no doubt that the blog ranks higher as it takes.

Blogs increases its popularity online. It increases its preference that almost all computer users, students to high officials in the government do blogs. Its capability ranks high for everyone is writing online.

Sites have what it takes to make blog ranks in a higher position. As the community evolves and moving faster, so as the blogs. In another own way, blogs itself ranks to the top.

Rice price crisis or food crisis April 12, 2008

Posted by Sakura in Current Events.
Tags: , , , , ,
add a comment

For just a few weeks, almost all the places in the Philippines suffered and get affected about the looming price increase of rice. Almost all of the topic on media publications, newspapers and Televisions had a very huge topic about the rice crisis. For just a period of time, the price of commercial rice were keep on increasing and shortage of local have been in demand. Wheats, corn and sweet potato had increased its amount as particular economic good or service that a consumer or group of consumers will want to purchase.

The country was in great affected that there is lack of rice supply. Almost all rice increases its price. Not only rice but the other goods which is basically purchased and commonly eat.

Shortage of rice had come for so many reasons, some where is of bad weather condition and the farmers haven’t got enough supply of fertilizers in order to enriched the planted rice and only harvested for almost 50% to 70% of their usual harvest.

Government agencies and the administration had several actions in order to minimize the problem but still haven’t got its alternative way. That is why, people from different local groups post for protest to at least take some concern about the price of rice–to at least lower its price.

Many people had been affected of this dilemma, especially to those who were poor and can’t afford the looming and increasing price of these basic staple. They are the one whose very affected on this crisis. For the daily income of some family they be able to meet the cost of rice, but for a sudden news of shortage of rice, families from different places had a worst manifestation to cope up the shortage and be able to
face the worst really in turmoil.

Rice crisis was brought a huge problem in the country and to the people. The lack supply of rice means not only a rice crisis but a food crisis itself. If the price of rice will continue its increasing status, for a no period of time basic goods like meats, fish and vegetables will tighten its competency to increase its price. So must the people will suffer and get more affected.

Unspoken Unfeigned Words April 10, 2008

Posted by bluejay002 in Literatures.
Tags: , , ,
add a comment

Unspoken Unfeigned Words
Jay Albano
(04-01-2008 8:49 GMT +8:00)

When I try to think of words I should tell you,
Nothing comes, it’s just so hard to think of one.
Just when i thought words would just came out,
It did not, nothing spills out when I’m with you.

And I wonder, why words are very hard to find.
I can say you are beautiful yet it does not suffice.
I can say you are smart, kind and responsible
But you’re worth more than that.
And so I wonder again, why is it so hard.

Alas, I came to realize that words are hard to find
When you try to say it to someone very special.
Yet I want you to realize that even there are words unspoken,
They are unfeigned and true in nature.

Pain of Life and Vanity April 10, 2008

Posted by bluejay002 in Literatures.
Tags: , , ,
4 comments

Pain of Life and Vanity
Jay Albano
(03-25-2008 10:04 +8:00 GMT)

Life is complex and often misunderstood.
It is partly composed of vile experiences that we, ourselves, caused.
We subdue others for our mistakes.

Yet God cares for us, you know why?
Because He does not look of what we are now
But He sees what we could become if we only understand His love.

He is jealous not because of what we have
But he is jealous of things He knew we could have,
Things that could make us better yet we do not have.

His love is simple yet amazing.
It is unmeasureable in any means we could think of,
And He gave us this love without reservation.

The passion of life is often subject to constant changes
because we could only hold on things so much
nothing more and most likely tend to keep it lesser.

God’s love is incomparable, loving us no matter what we are.
A care no one could ever give.
He is always inside you, knocking, waiting.

Open your heart and you will understand.
Choose righteousness and you will see His greatness.
Choose God and you will realize everything else is vanity.