mirror of
				https://github.com/stedolan/jq.git
				synced 2024-05-11 05:55:39 +00:00 
			
		
		
		
	'length' function now measures string length in codepoints, not bytes.
This commit is contained in:
		
							
								
								
									
										2
									
								
								lexer.l
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								lexer.l
									
									
									
									
									
								
							@@ -93,7 +93,7 @@ struct lexer_param;
 | 
			
		||||
  (\\[^u(]|\\u[a-zA-Z0-9]{0,4})+ {
 | 
			
		||||
    /* pass escapes to the json parser */
 | 
			
		||||
    jv escapes = jv_string_fmt("\"%.*s\"", yyleng, yytext);
 | 
			
		||||
    yylval->literal = jv_parse_sized(jv_string_value(escapes), jv_string_length(jv_copy(escapes)));
 | 
			
		||||
    yylval->literal = jv_parse_sized(jv_string_value(escapes), jv_string_length_bytes(jv_copy(escapes)));
 | 
			
		||||
    jv_free(escapes);
 | 
			
		||||
    return QQSTRING_TEXT;
 | 
			
		||||
  }
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user