pict
pict copied to clipboard
Fix Japanese Kanji character handling in constraints
Issue
Japanese Kanji character "予" was causing exceptions in constraint expressions:
- When used in conditions like
if [予] = "Hoge", it would throw:Input Error: Non-special character was escaped - When used as a single character parameter name:
if [予] = "Hoge" then [Foo] = "Bar", it would throw:Input Error: Misplaced THEN keyword or missing logical operator
Root Cause
Two separate issues were identified:
- The comparison in the
getStringfunction was mistakenly treating the Kanji character as a backslash (special character marker) - Some constraint expressions were missing the required semicolon terminator
Fix
- Modified the special character detection logic in
getStringfunction to use an explicit backslash literal comparison (L'\\') instead of the macro - Added test cases to verify the fix works correctly:
-
test/japanese_kanji.txt- Tests a Japanese Kanji character in parameter names and constraints -
test/special_chars.txt- Tests proper handling of escaped quotes
-
This change ensures that Unicode characters like Japanese Kanji are handled correctly in parameter names and constraint expressions.
Fixes #74.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.