PL/SQL Web Toolkit to create downloadable UTF-8 with BOM document with Chinese content

 

I encountered a problem when generating a UTF-8 CSV document with chinese words using the following code:

DECLARE

v_blob          BLOB;

BEGIN

dbms_lob.createtemporary(v_blob, TRUE);

dbms_lob.append(v_blob, TO_BLOB(utl_raw.cast_to_raw(‘any text…中文字…’)));

wpg_docload.download_file(v_blob);

dbms_lob.freetemporary(v_blob);

END;

When using Microsoft Excel 2010 to open the file in Windows 7, the chinese words cannot be displayed correctly (Even notepad can display it correct) . After investigation, it is found that the Excel can only display chinese words correctly when the file is encoded using UTF-8 with BOM. Therefore, I did some experiments and add the BOM by myself with the following code:

DECLARE

v_blob          BLOB;

BEGIN

dbms_lob.createtemporary(v_blob, TRUE);

dbms_lob.append(v_blob, TO_BLOB(HEXTORAW(‘EFBBBF’))); — Add BOM at the beginning: HEXTORAW(‘EFBBBF’)

dbms_lob.append(v_blob, TO_BLOB(utl_raw.cast_to_raw(‘any text…中文字…’)));

wpg_docload.download_file(v_blob);

dbms_lob.freetemporary(v_blob);

END;

The BOM is magical!

JavaScript: parseInt() bug with "08" and "09"

When calling parseInt(“08″) or parseInt(“09″) in browsers, it will return 0 instead of 8 and 9.

It is because it treats the numbers (with 0 in front) as octal. Since octal don’t have “08″ and “09″, so that it will return 0 instead.

The solutions will be:

(1) don’t add the zero before the number, i.e. parseInt(“8″) and parseInt(“9″)

(2) specify the radix, i.e. parseInt(“08″, 10) and parseInt(“09″, 10)

(3) use parseFloat instead of parseInt, i.e. parseFloat (“08″) and parseFloat (“09″)

 

References:

http://www.breakingpar.com/bkp/home.nsf/0/87256B280015193F87256C85006A6604

http://www.ventanazul.com/webzine/articles/issues-parseint-javascript

http://www.w3schools.com/jsref/jsref_parseint.asp

Adium Bug ! Crash with Hotmail web !

I could not log in to my MSN passport with Adium since last weekend… it keeps prompting “Error: You have signed on from another location” 

Luckily, I got an answer from macrumors today (http://forums.macrumors.com/showthread.php?t=1087445)

Its a known bug, it will be fixed in the next Adium version.
The problem arises when having a Hotmail mailbox open.
here is the ticket
http://trac.adium.im/ticket/13654

So, the solution is … DO NOT left your hotmail open in somewhere else … when you want to use Adium for MSN ..

 

Customizing Your Win 7 Logon Screen

The easiest way to change the default logon wallpaper is to use Local Group Policy Editor

  1. Open the Local Group Policy Editor by Cmd + R, and enter gpedit.msc
  2. Go to Computer Configuration > Administrative Templates > System > Logon
  3. Enable the option of Always use custom logon background
  4. Click OK / Apply button and close the editor
  5. Open windows explorer, go to and create a directory - C:WindowsSystem32oobeinfobackgrounds
  6. Put your desired background as backgroundDefault.jpg under the directory while your image size must be less then 256KB
  7. Done ! Try to Cltrl+Alt+Del to see the result.

You may also enable the option by editing the registry instead of group policy. Details can be found at http://www.winhelponline.com/blog/windows-7-lets-you-change-the-logon-background-image/

Jubeat Copious

Jubeat Copious is released in HK finally. Time to burn $ again

10 Free Serif Fonts

Today I found a good link from Twitter that provides 10 free serif fonts. Good to try in my web / mobile apps later!

http://www.oakesdesign.ca/10-free-serif-fonts

Jubeat Knit Arrives in HK @ 12 Aug 2010

Jubeat Knit (第3代 Jubeat) 終於黎到香港啦,今次KONAMI做野好快手,唔知係唔係因為上次APPEND只係日本限定俾人話得多:P~~

今日香港,澳門,台灣,韓國都一齊UPGRADE, 個新INTERFACE唔係好用得慣,不過D新歌真係幾難玩,今日度度機舖都超多人,我都係玩左一陣ONLY

 

Jubeat Knit Released!!

http://www.ea-pass.konami.jp/service/service_jubeat.html

The new Jubeat Knit seems so cute! However, you can only get it after you have played at least once with your konami e-amusement pass. Waiting for HK upgrade ~~

There are two special editions of e-amusement pass for Jubeat Knit. I think the yellow one is so attractive.

Gigi New Album 2010

終於出新廣東碟啦~我都好耐冇買CD LOL

Jubeat Knit

今日JUBEAT STAFF POST左一幅黎緊JUBEAT KNIT 會有既歌 Cover 既組合圖~ 大家可以先賭為快~~

暫時已知新歌有以下幾首:

Song Name Author BASIC ADVANCED EXTREME
KONAMIオリジナル
さよならトリップ Dormir 3 7 8
ALL MY HEART -この恋に、わたしの全てを賭ける- SUPER HEROINE 彩香 -AYAKA- 4 7 9
Shining Wizard 96 5 8 10
ライセンス楽曲(本人歌唱)
only my railgun fripSide 3 6 8
銀河 フジファブリック 3 7 9
SHINE×SHINE×SHINE×SHINE エイプリルズ 2 6 7
paparuwa Fantastic Plastic Machine 3 6 8
Love Space Ship SHANADOO 2 4 7
ライセンス楽曲(カバー)
Supercalifragilisticexpialidocious 4 5 8

Youtube Preview:
http://www.youtube.com/watch?v=tlaj_0mPO8o&feature=PlayList&p=292249CC5D5085CA&playnext_from=PL&index=0&playnext=1