@@ -44,9 +44,9 @@ Comparison is done directly unless you happen to be comparing the same
44
44
string in different encodings.
45
45
46
46
nzchar and nchar(, "bytes") are independent of the encoding
47
- nchar(, "char") nchar(, "width") handle UTF-8 and Latin-1 directly
47
+ nchar(, "char") nchar(, "width") handle UTF-8 and Latin-1 directly
48
48
substr substr<- handle UTF-8 and Latin-1 directly
49
- tolower toupper chartr translate UTF-8 and Latin-1 to wchar (which needs
49
+ tolower toupper chartr translate UTF-8 and Latin-1 to wchar (which needs
50
50
Unicode wide characters), rest to current charset
51
51
abbreviate translates non-ASCII inputs to UTF-8 then wchar_t*.
52
52
strtrim translates to the native encoding
@@ -346,7 +346,7 @@ attribute_hidden SEXP do_nchar(SEXP call, SEXP op, SEXP args, SEXP env)
346
346
switch (res ) {
347
347
case -1 :
348
348
error (_ ("invalid multibyte string, element %lld" ), (long long )i + 1 );
349
- case -2 :
349
+ case -2 :
350
350
if (type_ == Chars )
351
351
error (_ ("number of characters is not computable in \"bytes\" encoding, element %lld" ),
352
352
(long long )i + 1 );
@@ -425,14 +425,13 @@ static void substr(const char *str, int len, int ienc, int sa, int so,
425
425
attribute_hidden SEXP
426
426
do_substr (SEXP call , SEXP op , SEXP args , SEXP env )
427
427
{
428
- SEXP s , x ;
429
428
checkArity (op , args );
430
- x = CAR (args );
429
+ SEXP x = CAR (args );
431
430
if (!isString (x ))
432
431
error (_ ("extracting substrings from a non-character object" ));
433
432
R_xlen_t len = XLENGTH (x );
434
- PROTECT ( s = allocVector (STRSXP , len ));
435
- SEXP lastel = NULL ;
433
+ SEXP s = PROTECT ( allocVector (STRSXP , len )),
434
+ lastel = NULL ;
436
435
if (len > 0 ) {
437
436
SEXP sa = CADR (args ),
438
437
so = CADDR (args );
@@ -825,7 +824,7 @@ static SEXP stripchars(const char * const inchar, int minlen, int usecl)
825
824
// lower-case vowels in English plus accented versions
826
825
static int vowels [] = {
827
826
0x61 , 0x65 , 0x69 , 0x6f , 0x75 ,
828
- 0xe0 , 0xe1 , 0x2e , 0xe3 , 0xe4 , 0xe5 ,
827
+ 0xe0 , 0xe1 , 0xe2 , 0xe3 , 0xe4 , 0xe5 ,
829
828
0xe8 , 0xe9 , 0xea , 0xeb , 0xec , 0xed , 0xee , 0xef ,
830
829
0xf2 , 0xf3 , 0xf4 , 0xf5 , 0xf6 , 0xf8 , 0xf9 , 0xfa , 0xfb , 0xfc ,
831
830
0x101 , 0x103 , 0x105 , 0x113 , 0x115 , 0x117 , 0x118 , 0x11b ,
@@ -1155,7 +1154,7 @@ attribute_hidden SEXP do_tolower(SEXP call, SEXP op, SEXP args, SEXP env)
1155
1154
wc [j ] = Ri18n_towlower (wc [j ]);
1156
1155
#else
1157
1156
/* This cannot cope with surrogate pairs,
1158
- if mbstowcs can make them. */
1157
+ if mbstowcs can make them. */
1159
1158
for (j = 0 ; j < nc ; j ++ ) wc [j ] = towctrans (wc [j ], tr );
1160
1159
#endif
1161
1160
nb = (int ) wcstombs (NULL , wc , 0 );
0 commit comments