text_direction_code_point_in_comment
The Unicode code point 'U+{0}' changes the appearance of text from how it's interpreted by the compiler.
Description
#The analyzer produces this diagnostic when it encounters source that contains text direction Unicode code points. These code points cause source code in either a string literal or a comment to be interpreted and compiled differently than how it appears in editors, leading to possible security vulnerabilities.
Example
#The following code produces this diagnostic twice because there are hidden characters at the start and end of the label string:
var label = 'Interactive text';
Common fixes
#If the code points are intended to be included in the string literal, then escape them:
var label = '\u202AInteractive text\u202C';
If the code points aren't intended to be included in the string literal, then remove them:
var label = 'Interactive text';
除非另有说明,文档之所提及适用于 Dart 3.7.3 版本,本页面最后更新时间: 2025-05-08。 查看文档源码 或者 报告页面问题。