Peerapong Kunasirirat's weblog

How to convert file with TIS-620 to UTF-8.

Friday Mar 02, 2007

The Mac OS X equipped with very useful command to convert file with different encoding. Today I will show how to convert from TIS-620 (Thai language) to UTF-8. 

$iconv -f tis-620 -t utf-8 source.xml > destination.xml

-f คือ format เดิมของไฟล์ (source encoding)
-t คือ format ที่ต้องการให้เป็น (destination encoding)
source.xml คือชื่อไฟล์ต้นฉบับ (source file)
destination.xml คือชื่อไฟล์ปลายทาง (result or destination file)

 

$ iconv -l    (to show supported encoding)

ANSI_X3.4-1968 ANSI_X3.4-1986 ASCII CP367 IBM367 ISO-IR-6 ISO646-US ISO_646.IRV:1991 US US-ASCII CSASCII
UTF-8 UTF8
UTF-8-MAC UTF8-MAC
ISO-10646-UCS-2 UCS-2 CSUNICODE
UCS-2BE UNICODE-1-1 UNICODEBIG CSUNICODE11
UCS-2LE UNICODELITTLE
ISO-10646-UCS-4 UCS-4 CSUCS4
UCS-4BE
UCS-4LE
UTF-16
UTF-16BE
UTF-16LE
UTF-32
UTF-32BE
UTF-32LE
UNICODE-1-1-UTF-7 UTF-7 CSUNICODE11UTF7
UCS-2-INTERNAL
UCS-2-SWAPPED
UCS-4-INTERNAL
UCS-4-SWAPPED
C99
JAVA
CP819 IBM819 ISO-8859-1 ISO-IR-100 ISO8859-1 ISO_8859-1 ISO_8859-1:1987 L1 LATIN1 CSISOLATIN1
ISO-8859-2 ISO-IR-101 ISO8859-2 ISO_8859-2 ISO_8859-2:1987 L2 LATIN2 CSISOLATIN2
ISO-8859-3 ISO-IR-109 ISO8859-3 ISO_8859-3 ISO_8859-3:1988 L3 LATIN3 CSISOLATIN3
ISO-8859-4 ISO-IR-110 ISO8859-4 ISO_8859-4 ISO_8859-4:1988 L4 LATIN4 CSISOLATIN4
CYRILLIC ISO-8859-5 ISO-IR-144 ISO8859-5 ISO_8859-5 ISO_8859-5:1988 CSISOLATINCYRILLIC
ARABIC ASMO-708 ECMA-114 ISO-8859-6 ISO-IR-127 ISO8859-6 ISO_8859-6 ISO_8859-6:1987 CSISOLATINARABIC
ECMA-118 ELOT_928 GREEK GREEK8 ISO-8859-7 ISO-IR-126 ISO8859-7 ISO_8859-7 ISO_8859-7:1987 CSISOLATINGREEK
HEBREW ISO-8859-8 ISO-IR-138 ISO8859-8 ISO_8859-8 ISO_8859-8:1988 CSISOLATINHEBREW
ISO-8859-9 ISO-IR-148 ISO8859-9 ISO_8859-9 ISO_8859-9:1989 L5 LATIN5 CSISOLATIN5
ISO-8859-10 ISO-IR-157 ISO8859-10 ISO_8859-10 ISO_8859-10:1992 L6 LATIN6 CSISOLATIN6
ISO-8859-13 ISO-IR-179 ISO8859-13 ISO_8859-13 L7 LATIN7
ISO-8859-14 ISO-CELTIC ISO-IR-199 ISO8859-14 ISO_8859-14 ISO_8859-14:1998 L8 LATIN8
ISO-8859-15 ISO-IR-203 ISO8859-15 ISO_8859-15 ISO_8859-15:1998
ISO-8859-16 ISO-IR-226 ISO8859-16 ISO_8859-16 ISO_8859-16:2000
KOI8-R CSKOI8R
KOI8-U
KOI8-RU
CP1250 MS-EE WINDOWS-1250
CP1251 MS-CYRL WINDOWS-1251
CP1252 MS-ANSI WINDOWS-1252
CP1253 MS-GREEK WINDOWS-1253
CP1254 MS-TURK WINDOWS-1254
CP1255 MS-HEBR WINDOWS-1255
CP1256 MS-ARAB WINDOWS-1256
CP1257 WINBALTRIM WINDOWS-1257
CP1258 WINDOWS-1258
850 CP850 IBM850 CSPC850MULTILINGUAL
862 CP862 IBM862 CSPC862LATINHEBREW
866 CP866 IBM866 CSIBM866
MAC MACINTOSH MACROMAN CSMACINTOSH
MACCENTRALEUROPE
MACICELAND
MACCROATIAN
MACROMANIA
MACCYRILLIC
MACUKRAINE
MACGREEK
MACTURKISH
MACHEBREW
MACARABIC
MACTHAI
HP-ROMAN8 R8 ROMAN8 CSHPROMAN8
NEXTSTEP
ARMSCII-8
GEORGIAN-ACADEMY
GEORGIAN-PS
KOI8-T
MULELAO-1
CP1133 IBM-CP1133
ISO-IR-166 TIS-620 TIS620 TIS620-0 TIS620.2529-1 TIS620.2533-0 TIS620.2533-1
CP874 WINDOWS-874
VISCII VISCII1.1-1 CSVISCII
TCVN TCVN-5712 TCVN5712-1 TCVN5712-1:1993
ISO-IR-14 ISO646-JP JIS_C6220-1969-RO JP CSISO14JISC6220RO
JISX0201-1976 JIS_X0201 X0201 CSHALFWIDTHKATAKANA
ISO-IR-87 JIS0208 JIS_C6226-1983 JIS_X0208 JIS_X0208-1983 JIS_X0208-1990 X0208 CSISO87JISX0208
ISO-IR-159 JIS_X0212 JIS_X0212-1990 JIS_X0212.1990-0 X0212 CSISO159JISX02121990
CN GB_1988-80 ISO-IR-57 ISO646-CN CSISO57GB1988
CHINESE GB_2312-80 ISO-IR-58 CSISO58GB231280
CN-GB-ISOIR165 ISO-IR-165
ISO-IR-149 KOREAN KSC_5601 KS_C_5601-1987 KS_C_5601-1989 CSKSC56011987
EUC-JP EUCJP EXTENDED_UNIX_CODE_PACKED_FORMAT_FOR_JAPANESE CSEUCPKDFMTJAPANESE
MS_KANJI SHIFT-JIS SHIFT_JIS SJIS CSSHIFTJIS
CP932
ISO-2022-JP CSISO2022JP
ISO-2022-JP-1
ISO-2022-JP-2 CSISO2022JP2
CN-GB EUC-CN EUCCN GB2312 CSGB2312
CP936 GBK
GB18030
ISO-2022-CN CSISO2022CN
ISO-2022-CN-EXT
HZ HZ-GB-2312
EUC-TW EUCTW CSEUCTW
BIG-5 BIG-FIVE BIG5 BIGFIVE CN-BIG5 CSBIG5
CP950
BIG5-HKSCS BIG5HKSCS
EUC-KR EUCKR CSEUCKR
CP949 UHC
CP1361 JOHAB
ISO-2022-KR CSISO2022KR
CP856
CP922
CP943
CP1046
CP1124
CP1129
CP1161 IBM-1161 IBM1161 CSIBM1161
CP1162 IBM-1162 IBM1162 CSIBM1162
CP1163 IBM-1163 IBM1163 CSIBM1163
DEC-KANJI
DEC-HANYU
437 CP437 IBM437 CSPC8CODEPAGE437
CP737
CP775 IBM775 CSPC775BALTIC
852 CP852 IBM852 CSPCP852
CP853
855 CP855 IBM855 CSIBM855
857 CP857 IBM857 CSIBM857
CP858
860 CP860 IBM860 CSIBM860
861 CP-IS CP861 IBM861 CSIBM861
863 CP863 IBM863 CSIBM863
CP864 IBM864 CSIBM864
865 CP865 IBM865 CSIBM865
869 CP-GR CP869 IBM869 CSIBM869
CP1125
EUC-JISX0213
SHIFT_JISX0213
ISO-2022-JP-3
ISO-IR-230 TDS565
RISCOS-LATIN1

 

[0] Comments
Like this post? del.icio.us | furl | slashdot | technorati | digg

CrossOver 6.0 and Floppy drive.

Friday Mar 02, 2007

Some softwares such as HDS Offline SVP for 99x0 needs to access configuration data from floppy drive, and the floppy drive has to be A: . For Windows platform, this condition has never been a problem, but for Mac OS X using CrossOver software, it is a little bit tricky to do.


    For CrossOver 6.x for Mac OS X, when inserting USB Floppy drive into USB slot, it appears in the bottle windows as G: drive mounted to /Volumes/CONFIG1, where CONFIG1 is the floppy disk label. In this regular case, the software that needs to access A: drive will never find the floppy.

   To archive this, please follow the steps below :

(1) Click on the "Configure" ==> "Manage Bottles"

(2) Click on the "winecfg" item, then click on "Launch selected item" button

(3) The 'Wine configuration" window will show, click on "Drives" tab

(4) Observe that there is no A: drive available at the moment

(5) Open the 'Terminal' window (Goto Finder/Go/Utilities), click on "Terminal"

(6) cd ~/Library/Application Support/CrossOver/Bottles/WinXP/dosdevices   (where WinXP is bottle's name)

(7) ln -s g:: a::

$ ls -l
total 88
lrwxr-xr-x   1 Neo  Neo   3 Mar  2 00:31 a:: -> g::
lrwxr-xr-x   1 Neo  Neo  10 Feb 28 17:17 c: -> ../drive_c
lrwxr-xr-x   1 Neo  Neo  13 Feb 28 17:17 d:: -> /dev/rdisk2s0
lrwxr-xr-x   1 Neo  Neo  18 Feb 28 17:48 e: -> /Volumes/Softwares
lrwxr-xr-x   1 Neo  Neo  13 Feb 28 17:48 e:: -> /dev/rdisk2s2
lrwxr-xr-x   1 Neo  Neo  18 Mar  1 23:26 f: -> /Volumes/Softwares
lrwxr-xr-x   1 Neo  Neo  13 Mar  1 23:26 f:: -> /dev/rdisk1s2
lrwxr-xr-x   1 Neo  Neo  16 Mar  2 00:27 g: -> /Volumes/CONFIG1
lrwxr-xr-x   1 Neo  Neo  11 Mar  1 23:26 g:: -> /dev/rdisk2
lrwxr-xr-x   1 Neo  Neo  10 Feb 28 17:17 y: -> /Users/Neo
lrwxr-xr-x   1 Neo  Neo   1 Feb 28 17:17 z: -> /

(8) ln -s g: a:
 $ ls -l
total 96
lrwxr-xr-x   1 Neo  Neo   2 Mar  2 00:32 a: -> g:
lrwxr-xr-x   1 Neo  Neo   3 Mar  2 00:31 a:: -> g::

lrwxr-xr-x   1 Neo  Neo  10 Feb 28 17:17 c: -> ../drive_c
lrwxr-xr-x   1 Neo  Neo  13 Feb 28 17:17 d:: -> /dev/rdisk2s0
lrwxr-xr-x   1 Neo  Neo  18 Feb 28 17:48 e: -> /Volumes/Softwares
lrwxr-xr-x   1 Neo  Neo  13 Feb 28 17:48 e:: -> /dev/rdisk2s2
lrwxr-xr-x   1 Neo  Neo  18 Mar  1 23:26 f: -> /Volumes/Softwares
lrwxr-xr-x   1 Neo  Neo  13 Mar  1 23:26 f:: -> /dev/rdisk1s2
lrwxr-xr-x   1 Neo  Neo  16 Mar  2 00:27 g: -> /Volumes/CONFIG1
lrwxr-xr-x   1 Neo  Neo  11 Mar  1 23:26 g:: -> /dev/rdisk2
lrwxr-xr-x   1 Neo  Neo  10 Feb 28 17:17 y: -> /Users/Neo
lrwxr-xr-x   1 Neo  Neo   1 Feb 28 17:17 z: -> /

 ==== It's done and ready to use ===

[0] Comments
Like this post? del.icio.us | furl | slashdot | technorati | digg

Windows Vista failed active virus testing.

Saturday Feb 10, 2007

Windows 'fails' active virus test

It has been said by Microsoft Chairman, Bill Gates, that Vista is the more secured than any other operating systems available on the market. @#$%^&*   Ok, ok, I will be a little bit open-minded. Try me, give me some proof. 

Testing with the virus bulletin ?, Ok I can accept that.   Then what's the result.

Oh man, you just failed me !!!. Below is what BBC report...

"Vista comes equipped with several different security tools Security tools that work with Windows Vista have failed tests to see if they can detect viruses circulating online. Microsoft's Windows Live OneCare security tool was one of four products that failed independent tests carried out by the Virus Bulletin.

The security testing group found that Live OneCare missed far more active viruses than any other program tested.

To pass the tests anti-virus tools must spot and stop 100% of the malicious programs used to attack them. "


Read more : (http://news.bbc.co.uk/2/hi/technology/6331959.stm)

[0] Comments
Like this post? del.icio.us | furl | slashdot | technorati | digg

StarOffice : The first StarOffice macro virus may be real.

Saturday Feb 10, 2007

Virus writers have created the first virus to affect StarOffice. It is called Stardust. Stardyst uses macros to attack Sun's (MS Office) alternative office suite. The malware was written as a proof-of-concept (POC) code to show what might be possible rather than as a serious attempt to create a new attack vector. In this POC, the macro will download Adult content to your documents.

Read more : (http://www.theregister.com/2006/06/01/stardust/)
 

[0] Comments
Like this post? del.icio.us | furl | slashdot | technorati | digg

OpenSourceMac.org : Another great Open Source Software site for Mac OS X

Wednesday Jan 17, 2007

I've introduced you guy the MacForge website in my blog (http://blogs.sun.com/Peerapong/entry/macforge_the_free_open_source). Today I found the may be older one but rather useful, it's the OpenSourceMac (www.OpenSourceMac.Org). It has most of serious applications you ever need to make your everyday life easier ranging from Web Browser, Digital Media Player, CD/DVD Burner, Podcast ripping tools, iPod syncing tools, Dream Weaver-like HTML developer tools, Professional Raster/Vector graphic tools, etc...

Give it a try... see for yourself. 

[0] Comments
Like this post? del.icio.us | furl | slashdot | technorati | digg

MoAB (a Month Of Apple Bugs)

Monday Jan 08, 2007

A Month Of Apple Bugs (MoAB)[Read More]

[0] Comments
Like this post? del.icio.us | furl | slashdot | technorati | digg

ถ้าท่านกำลังมองหา 'รูปแบบตัวอย่าง' ของเหล็กดัด ที่นี่รวม URL ไว้แล้ว

Thursday Jan 04, 2007

ที่นี่รวม URL ไว้แล้ว [Read More]

[0] Comments
Like this post? del.icio.us | furl | slashdot | technorati | digg

NeoOffice : Don't forget to update your neooffice patch, it's now patch 11 !!!

Thursday Jan 04, 2007

I haven't updated my own copy for a while, when I checked back. It's now patch 11 already.[Read More]

[0] Comments
Like this post? del.icio.us | furl | slashdot | technorati | digg

Mac OS X Full Keyboard shortcut list 8-)

Thursday Jan 04, 2007

Collected from various sites.[Read More]

[0] Comments
Like this post? del.icio.us | furl | slashdot | technorati | digg

ท่านรู้ไหมว่า คณะวิศวฯ ม.อ. ถูกจัดอันดับที่เท่าไรในสาขา วิศวกรรมศาสตร์ด้วยกัน..

Wednesday Jan 03, 2007

ลองเข้าไปดูซิ ดีทีเดียวแหละ นี่แหละมหาวิทยาลัยผม ฮาฮา[Read More]

[0] Comments
Like this post? del.icio.us | furl | slashdot | technorati | digg

ZFS by examples

Wednesday Jan 03, 2007

Step-by-step of my testing of ZFS using Solaris 10 x86 (update 2)[Read More]

[0] Comments
Like this post? del.icio.us | furl | slashdot | technorati | digg

Sun's softwares and hardwares won "InfoWorld 2007 Technology of the year awards"

Wednesday Jan 03, 2007

Sun won InfoWorld 2007 Technology of the year awards[Read More]

[0] Comments
Like this post? del.icio.us | furl | slashdot | technorati | digg

MacForge : the FREE Open Source softwares for your MAC OS....

Monday Dec 18, 2006

MacForge : the FREE Open Source softwares for your MAC OS....[Read More]

[0] Comments
Like this post? del.icio.us | furl | slashdot | technorati | digg

Using Gmail with Apple Mail (on Mac OS X)

Thursday Nov 23, 2006

Step-by-step to setup Gmail account in Applet Mail (Mac OS X)[Read More]

[0] Comments
Like this post? del.icio.us | furl | slashdot | technorati | digg

Apple Notebook and iPod Battery information

Tuesday Nov 21, 2006

Apple Notebook and iPod Battery information[Read More]

[0] Comments
Like this post? del.icio.us | furl | slashdot | technorati | digg