Displaying 6 results from an estimated 6 matches for "mb_st".
2007 Jun 24
2
problem gsub in the locale of CP932 and SJIS (PR#9751)
...00 +0900
+++ R-2.5.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')...
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
...f --git src/main/grep.c src/main/grep.c
index 6e6ec3e..348c63d 100644
--- 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, &a...
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
2006 Oct 17
1
crush in edit()
Dear all,
I am new to R system. When I tried to edit data read from a csv file, R
system crushed, I got an error message as follows:
> edit(data)
*** buffer overflow detected ***: /usr/lib/R/bin/exec/R terminated
======= Backtrace: =========
/lib/libc.so.6(__chk_fail+0x41)[0x49d020b1]
/lib/libc.so.6[0x49d034a2]
/usr/lib/R/modules//R_X11.so[0x33ed7a]
/usr/lib/R/modules//R_X11.so[0x34050d]
2006 Oct 17
1
crush in edit()
Dear all,
I am new to R system. When I tried to edit data read from a csv file, R
system crushed, I got an error message as follows:
> edit(data)
*** buffer overflow detected ***: /usr/lib/R/bin/exec/R terminated
======= Backtrace: =========
/lib/libc.so.6(__chk_fail+0x41)[0x49d020b1]
/lib/libc.so.6[0x49d034a2]
/usr/lib/R/modules//R_X11.so[0x33ed7a]
/usr/lib/R/modules//R_X11.so[0x34050d]