The R Project SVN R

Rev

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

Rev 73507 Rev 73508
Line 220... Line 220...
220
	    if (byte >= 0xD800 && byte <= 0xDFFF) return -1; /* surrogate */
220
	    if (byte >= 0xD800 && byte <= 0xDFFF) return -1; /* surrogate */
221
	    // Following Corrigendum 9, these are valid in UTF-8
221
	    // Following Corrigendum 9, these are valid in UTF-8
222
//	    if (byte == 0xFFFE || byte == 0xFFFF) return -1;
222
//	    if (byte == 0xFFFE || byte == 0xFFFF) return -1;
223
	    return 3;
223
	    return 3;
224
	} else return -1;
224
	} else return -1;
225
    } else if (byte < 0xF4) { // for RFC3629
225
    } else if (byte <= 0xF4) { // for RFC3629
226
	if (!s[1] || !s[2] || !s[3]) return -2;
226
	if (!s[1] || !s[2] || !s[3]) return -2;
227
	if (((s[1] & 0xC0) == 0x80)
227
	if (((s[1] & 0xC0) == 0x80)
228
	    && ((s[2] & 0xC0) == 0x80)
228
	    && ((s[2] & 0xC0) == 0x80)
229
	    && ((s[3] & 0xC0) == 0x80)) {
229
	    && ((s[3] & 0xC0) == 0x80)) {
230
	    *w = (int) (((byte & 0x07) << 18)
230
	    *w = (int) (((byte & 0x07) << 18)