From hutcha.s at psu.ac.th  Wed Apr 20 07:11:12 2005
From: hutcha.s at psu.ac.th (hutcha.s@psu.ac.th)
Date: Wed Apr 20 07:11:24 2005
Subject: [Rd] localeToCharset error for Thai locale (PR#7799)
Message-ID: <20050420051112.890C1A1DE@slim.kubism.ku.dk>

Full_Name: Hutcha Sriplung
Version: 2.1.0
OS: windows
Submission from: (NULL) (202.12.74.9)


In R-2.1.0, I found that 'example' function does not work properly and report an
error message as shown below on a Windows machine (running r-devel release) but
not on Linux.

> example(attach)
Error in switch(x[2], "1250" = return("ISO 8859-2"), "1251" = return("KOI8-U"), 
: argument is missing, with no default

I tracked the source codes and finally found minor mistakes with Thai language
management on Windows platform in 'localeToCharset' function.

file: /R-2.1.0/src/library/utils/iconv.R 
line: 50
if (en %in% "th") 	<<-- Should be "tg"-tajik???     
    return("KOI8-T")

"th" is for Thai (TIS-620; already defined on line 48-49).

line: 53-56
"874" = return("TIS 620")   <<-- Should be added???   
A default return should also be stated???

Note: 
> Sys.getlocale("LC_CTYPE")
[1] "Thai_Thailand.874"

'example' works fine on a Linux machine.


[Rd] localeToCharset error for Thai locale (PR#7799)
hutcha.s@psu.ac.th