<I was not sure if this should go to R-devel or R-help.  If I e-mailed this
to the wrong place, please let me know.>

Hello dear R-devel members,

I came by an oddity, with regards to how character variables are being
transformed when they are in Hebrew, and when Sys.setlocale is changed.

Here is an example:


# first, let's set the locale to Hebrew
Sys.setlocale("LC_ALL", "Hebrew") # Setting locale
x <- "שלום" # Now let's put "Peace" (in Hebrew) into variable x
> x

#[1] "שלום"  # it is still correctly preserved

Sys.setlocale("LC_ALL", "English")  # let's change the local
y <- "שלום"  # Now let's enter "peace" to variable y
x ; y  # comparing variables x and y shows that x was changed while y wasn't

#[1] "ùìåí"
#[1] "שלום"

# Do we want them to be different?

# Now If we run Sys.setlocale again, we won't see any change in y or x:
Sys.setlocale("LC_ALL", "English")
x ; y

#[1] "ùìåí"
#[1] "שלום"


# while if we run it in Hebrew
 Sys.setlocale("LC_ALL", "Hebrew")
 x ; y  # it will change x but not y
#[1] "שלום"
#[1] "שלום"

# and changing this back to English will only change x but not y
Sys.setlocale("LC_ALL", "English")
x ; y
#[1] "ùìåí"
#[1] "שלום"


This leads me to two questions:
1) Is this a desired property of  Sys.setlocale (or of the storage system of
the variables in R) ?
2) Is there a function that can change x to be like y?


Thanks,
Tal




----------------Contact
Details:-------------------------------------------------------
Contact me: Tal.Galili@gmail.com |  972-52-7275845
Read me: www.talgalili.com (Hebrew) | www.biostatistics.co.il (Hebrew) |
www.r-statistics.com (English)
----------------------------------------------------------------------------------------------

	[[alternative HTML version deleted]]

