Skip to content

Conversation

Copy link

Copilot AI commented May 19, 2025

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:

  1. The comparison in the getString function was mistakenly treating the Kanji character as a backslash (special character marker)
  2. Some constraint expressions were missing the required semicolon terminator

Fix

  1. Modified the special character detection logic in getString function to use an explicit backslash literal comparison (L'\\') instead of the macro
  2. 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.

Copilot AI and others added 2 commits May 19, 2025 17:50
Co-authored-by: jaccz <9115223+jaccz@users.noreply.github.com>
Co-authored-by: jaccz <9115223+jaccz@users.noreply.github.com>
Copilot AI changed the title [WIP] Japanes Kanji "予" would be cause of exception in if expression Fix Japanese Kanji character handling in constraints May 19, 2025
Copilot AI requested a review from jaccz May 19, 2025 17:54
Copilot finished work on behalf of jaccz May 19, 2025 17:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Japanes Kanji "予" would be cause of exception in if expression

2 participants