Comparing accented strings from .fig files

1 回表示 (過去 30 日間)
Luc Le Blanc
Luc Le Blanc 2013 年 10 月 16 日
コメント済み: Luc Le Blanc 2013 年 10 月 17 日
Using strcmpi to compare combo box accented strings from a .fig (GUIDE) file fails. Checking these accented strings, I see each accented letter occupies 2 bytes. Is there another API that can successfully perform this string comparison with another string passed as a literal between '' ?

回答 (1 件)

Jan
Jan 2013 年 10 月 16 日
編集済み: Jan 2013 年 10 月 16 日
This is not clear yet. What is a "combo box" and does this detail matter at all? What is an "accented string"? A small example would reveal this important detail.
Not only "accented letters" occupy 2 bytes, but all characters have this property. The underlying type of char is UINT16, such that they can carry UTF16 strings. STRCMP can successfully handle them, so please explain the details of your problem.
What does "with another string passed as a literal between" mean?
  5 件のコメント
Jan
Jan 2013 年 10 月 17 日
@Luc: No, if there is a \n, you must have inserted it there. What exactly do you mean by "list"? This could be a cell string or a char-string with line breaks, a struct vector, ... ?
Luc Le Blanc
Luc Le Blanc 2013 年 10 月 17 日
I meant lists of strings in those drop-down lists. I just checked some 60 dialogs (.fig) and indeed, this '\n' prefix was the exception. Comparison works now. Phew!

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeCharacters and Strings についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by