开发者

Using Unicode in Oracle and PHP

开发者 https://www.devze.com 2022-12-18 19:13 出处:网络
I am currently making a web application, I want to add Unicode support in my application. My application is a search based application. I store some keyword and some text in my database,and show the r

I am currently making a web application, I want to add Unicode support in my application. My application is a search based application. I store some keyword and some text in my database, and show the result according to keyword in a search query.

I am using Oracle 10g XE edition and PHP 5.

I know nothi开发者_如何学Cng about adding Unicode.


First of all, have you downloaded a version of XE which supports UNICODE? Not all of them do. Check out the XE Download page.

OTN has a white paper on Unicode in the database. It's a few years old now, but it still covers the ground. Read it now. If you need detailed information regarding implementation read the Oracle Globalization Reference.

Finally, no overview of Unicode would be complete without a link to Joel's article "The Absolute Minimum Every Software Developer Absolutely, Positively Must Know About Unicode and Character Sets (No Excuses!)".


PHP isn't aware of charsets; Its strings are byte-arrays. This means that if you want to handle unicode strings, you will have to deal with encodings manually. The most common solution is to use utf-8 encoded strings both internally and externally. Without knowing for sure, I'd expect that Oracle can communicate in utf-8?

Generally, if you don't know the difference between bytes, characters, encodings and charsets, you'll probably get burned.

0

精彩评论

暂无评论...
验证码 换一张
取 消