The R Project SVN R

Rev

Rev 71883 | Rev 79309 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 71883 Rev 74706
Line 1... Line 1...
1
% File src/library/base/man/icuSetCollate.Rd
1
% File src/library/base/man/icuSetCollate.Rd
2
% Part of the R package, https://www.R-project.org
2
% Part of the R package, https://www.R-project.org
3
% Copyright 2008-2017 R Core Team
3
% Copyright 2008-2018 R Core Team
4
% Distributed under GPL 2 or later
4
% Distributed under GPL 2 or later
5
 
5
 
6
\name{icuSetCollate}
6
\name{icuSetCollate}
7
\alias{icuSetCollate}
7
\alias{icuSetCollate}
8
\alias{icuGetCollate}
8
\alias{icuGetCollate}
Line 69... Line 69...
69
      \code{strcmp} is used instead, which should sort byte-by-byte in
69
      \code{strcmp} is used instead, which should sort byte-by-byte in
70
      (unsigned) numerical order.}
70
      (unsigned) numerical order.}
71
    \item{\code{"default"}:}{
71
    \item{\code{"default"}:}{
72
      obtains the locale from the OS as is done at the start of the
72
      obtains the locale from the OS as is done at the start of the
73
      session.  If environment variable \env{R_ICU_LOCALE} is set to a
73
      session.  If environment variable \env{R_ICU_LOCALE} is set to a
74
      non-empty value, its value is used rather than consulting the OS.
74
      non-empty value, its value is used rather than consulting the OS,
-
 
75
      unless environment variable \env{LC_ALL} is set to 'C' (or unset but
-
 
76
      \env{LC_COLLATE} is set to 'C').
75
    }
77
    }
76
    \item{\code{""}, \code{"root"}:}{
78
    \item{\code{""}, \code{"root"}:}{
77
      the \sQuote{root} collation: see
79
      the \sQuote{root} collation: see
78
      \url{http://www.unicode.org/reports/tr35/tr35-collation.html#Root_Collation}.
80
      \url{http://www.unicode.org/reports/tr35/tr35-collation.html#Root_Collation}.
79
    }
81
    }
Line 83... Line 85...
83
  report that a locale is not supported, but falls back to its idea of
85
  report that a locale is not supported, but falls back to its idea of
84
  \sQuote{best fit} (which could be rather different and is reported by
86
  \sQuote{best fit} (which could be rather different and is reported by
85
  \code{icuGetCollate("actual")}, often \code{"root"}).  Most English
87
  \code{icuGetCollate("actual")}, often \code{"root"}).  Most English
86
  locales fall back to \code{"root"} as although e.g.\sspace{}\code{"en_GB"} is
88
  locales fall back to \code{"root"} as although e.g.\sspace{}\code{"en_GB"} is
87
  a valid locale (at least on some platforms), it contains no special
89
  a valid locale (at least on some platforms), it contains no special
88
  rules for collation.  Note that \code{"C"} is not a supported ICU locale.
90
  rules for collation.  Note that \code{"C"} is not a supported ICU locale
-
 
91
  and hence \env{R_ICU_LOCALE} should never be set to \code{"C"}.
89
  
92
  
90
  Some examples are \code{case_level = "on", strength = "primary"} to ignore
93
  Some examples are \code{case_level = "on", strength = "primary"} to ignore
91
  accent differences and \code{alternate_handling = "shifted"} to ignore
94
  accent differences and \code{alternate_handling = "shifted"} to ignore
92
  space and punctuation characters.
95
  space and punctuation characters.
93
  
96
  
94
  Initially ICU will not be used for collation if the OS is set to use
97
  Initially ICU will not be used for collation if the OS is set to use the
95
  the \code{C} locale for collation.  Once this function is called with
98
  \code{C} locale for collation and \env{R_ICU_LOCALE} is not set.  Once
96
  a value for \code{locale}, ICU will be used until it is called again
99
  this function is called with a value for \code{locale}, ICU will be used
97
  with \code{locale = "none"}.
100
  until it is called again with \code{locale = "none"}.  ICU will not be
-
 
101
  used once \code{Sys.setlocale} is called with a \code{"C"} value for
-
 
102
  \code{LC_ALL} or \code{LC_COLLATE}, even if \env{R_ICU_LOCALE} is set. 
-
 
103
  ICU will be used again honoring \env{R_ICU_LOCALE} once
-
 
104
  \code{Sys.setlocale} is called to set a different collation order. 
-
 
105
  Environment variables \env{LC_ALL} (or \env{LC_COLLATE}) take precedence
-
 
106
  over \env{R_ICU_LOCALE} if and only if they are set to 'C'.  Due to the
-
 
107
  interaction with other ways of setting the collation order,
-
 
108
  \env{R_ICU_LOCALE} should be used with care and only when needed.
98
 
109
 
99
  All customizations are reset to the default for the locale if
110
  All customizations are reset to the default for the locale if
100
  \code{locale} is specified: the collation engine is reset if the
111
  \code{locale} is specified: the collation engine is reset if the
101
  OS collation locate category is changed by \code{\link{Sys.setlocale}}.
112
  OS collation locate category is changed by \code{\link{Sys.setlocale}}.
102
}
113
}