search for: mbs_init

Displaying 6 results from an estimated 6 matches for "mbs_init".

Did you mean: mac_init
2007 Jun 24
2
problem gsub in the locale of CP932 and SJIS (PR#9751)
...0/src/main/character.c 2007-06-24 22:31:06.000000000 +0900 @@ -986,6 +986,17 @@ char *p = repl; n = strlen(repl) - (regmatch[0].rm_eo - regmatch[0].rm_so); while (*p) { +#ifdef SUPPORT_MBCS + if(mbcslocale){ + int clen; + mbstate_t mb_st; + mbs_init(&mb_st); + if((clen = Mbrtowc(NULL, p, MB_CUR_MAX, &mb_st)) > 1){ + p+=clen; + continue; + } + } +#endif if (*p == '\\') { if ('1' <= p[1] && p[1] <= '9') { k =...
2015 Mar 02
2
Errors on Windows with grep(fixed=TRUE) on UTF-8 strings
On Windows, grep(fixed=TRUE) throws errors with some UTF-8 strings. Here's an example (must be run on Windows to reproduce the error): Sys.setlocale("LC_CTYPE", "chinese") y <- rawToChar(as.raw(c(0xe6, 0xb8, 0x97))) Encoding(y) <- "UTF-8" y # [1] "?" grep("\n", y, fixed = TRUE) # Error in grep("\n", y, fixed = TRUE) : invalid
2015 Mar 04
0
Errors on Windows with grep(fixed=TRUE) on UTF-8 strings
...44 --- src/main/grep.c +++ src/main/grep.c @@ -664,27 +664,27 @@ static int fgrep_one(const char *pat, const char *target, } return -1; } - if (!useBytes && mbcslocale) { /* skip along by chars */ - mbstate_t mb_st; + if (!useBytes && use_UTF8) { int ib, used; - mbs_init(&mb_st); for (ib = 0, i = 0; ib <= len-plen; i++) { if (strncmp(pat, target+ib, plen) == 0) { if (next != NULL) *next = ib + plen; return i; } - used = (int) Mbrtowc(NULL, target+ib, MB_CUR_MAX, &mb_st); + used = utf8clen(target[ib]); if (used <= 0)...
2005 Jul 20
1
(PR#8017) build of REventLoop package crashes with 2.1 due
...har.h> > < #endif > < > < /* main/util.c */ > < void UNIMPLEMENTED_TYPE(char *s, SEXP x); > < void UNIMPLEMENTED_TYPEt(char *s, SEXPTYPE t); > < Rboolean utf8strIsASCII(char *str); > < #ifdef SUPPORT_MBCS > < int utf8clen(char c); > < #define mbs_init(x) memset(x, 0, sizeof(mbstate_t)) > < size_t Mbrtowc(wchar_t *wc, const char *s, size_t n, mbstate_t *ps); > < void mbcsToLatin1(char *in, char *out); > < Rboolean mbcsValid(char *str); > < char *Rf_strchr(const char *s, int c); > < char *Rf_strrchr(const char *s, int...
2005 Jul 19
0
build of REventLoop package crashes with 2.1 due tosyntax error in Defn.h (PR#8017)
...p; defined(SUPPORT_MBCS) < #include <wchar.h> < #endif < < /* main/util.c */ < void UNIMPLEMENTED_TYPE(char *s, SEXP x); < void UNIMPLEMENTED_TYPEt(char *s, SEXPTYPE t); < Rboolean utf8strIsASCII(char *str); < #ifdef SUPPORT_MBCS < int utf8clen(char c); < #define mbs_init(x) memset(x, 0, sizeof(mbstate_t)) < size_t Mbrtowc(wchar_t *wc, const char *s, size_t n, mbstate_t *ps); < void mbcsToLatin1(char *in, char *out); < Rboolean mbcsValid(char *str); < char *Rf_strchr(const char *s, int c); < char *Rf_strrchr(const char *s, int c); < #else < #def...
2009 Apr 09
3
type.convert (PR#13646)
Full_Name: Stefan Raberger Version: 2.8.1 OS: Windows XP Submission from: (NULL) (213.185.163.242) Hi there, I recently noticed some strange behaviour of the command "type.convert", depending on the startup mode used. But there also seems to be different behaviour on different PCs (all running the same OS and the same version of R). On PC1: When I start R in SDI mode (RGui --no-save