Incorrect Value When Reading Japanese Character in Configuration File using LabVIEW

Updated Feb 29, 2024

Reported In

Programming Language

  • LabVIEW G

Issue Details

I am using Japanese word as one of the section name in a configuration file (.ini). When using Get Section Names.vi to acquire the section name, the return value is incorrect. How to read the correct section names in a configuration file using LabVIEW?

The configuration file is set as below where "回転数" is the section name, "鍵" is the key, and "test no 1" is the key's value.
 
[回転数]
鍵 = "test no 1"

The section name returned by Get Section Names.vi is "回・". as shown below.

return value.png
 

Solution

This is expected behavior due to how certain Japanese word is encoded in Shift JIS.

The word "転" is coded in 2 bytes as Hex 935d where the second byte Hex 5d is also use by close square bracket "]" sign which causing LabVIEW to read it as close square bracket of the section name.

There is no solution for this thus you need to make sure there is no such character is use in the configuration file.

Additional Information

The list of character where the second byte have sign that is normally use as regular expression or meta-character.
Second Byte Hex ValueSymbolCharacter
0x40@ァ А 院 魁 機 掘 后 察 宗 拭 繊 叩 邸 如 鼻 法 諭 蓮 僉 咫 奸 廖 戞 曄 檗 漾 瓠 磧 紂 隋 蕁 襦 蹇 錙 顱 鵝 硃 菑
0x5b      [    ー ゼ Ъ 閏 骸 擬 啓 梗 纂 充 深 措 端 甜 納 票 房 夕 麓 兌 喙 媼 彈 拏 杣 歇 濕 畆 禺 綣 膽 藜 觴 躰 鐚 饉 鷦 神 蕺   
0x5c \  ― ソ Ы 噂 浬 欺 圭 構 蚕 十 申 曾 箪 貼 能 表 暴 予 禄 兔 喀 媾 彌 拿 杤 歃 濬 畚 秉 綵 臀 藹 觸 軆 鐔 饅 鷭 祥 薌 
0x5d ]  ‐ ゾ Ь 云 馨 犠 珪 江 讃 従 疹 曽 綻 転 脳 評 望 余 肋 兢 咯 嫋 彎 拆 枉 歉 濔 畩 秕 緇 臂 蘊 訃 躱 鐓 饐 鷯 祹 薏 
0x5e ^ / タ Э 運 蛙 疑 型 洪 賛 戎 真 楚 耽 顛 膿 豹 某 与 録 竸 喊 嫂 弯 擔 杰 歐 濘 畤 秧 綽 膺 蘓 訖 躾 鐃 饋 鷽 禍 薢 
0x5f _ \ ダ Ю 雲 垣 祇 契 浩 酸 柔 神 狙 胆 点 農 廟 棒 誉 論 兩 喟 媽 彑 拈 枩 歙 濱 畧 秬 綫 臉 蘋 訐 軅 鐇 饑 鸚 禎 薰 
0x60 ` A チ Я 荏 柿 義 形 港 餐 汁 秦 疏 蛋 伝 覗 描 冒 輿 倭 兪 啻 嫣 彖 拜 杼 歔 濮 畫 秡 總 臍 藾 訌 軈 鐐 饒 鸛 
0x7b { + ボ к 閲 顎 宮 鶏 砿 施 旬 須 捜 畜 怒 倍 府 本 養 几 嘴 學 悳 掉 桀 毬 炮 痣 窖 縵 艝 蛔 諚 轆 閔 驅 黠 笻 螈 
0x7c  ポ л 榎 掛 弓 芸 鋼 旨 楯 酢 掃 竹 倒 培 怖 翻  慾 處 嘶 斈 忿 掟 桍 毫 烟 痞 窩 縹 艚 蛞 諫 轎 閖 驂 黥 筇 螬 
0x7d } マ м 厭 笠 急 迎 閤 枝 殉 図 挿 筑 党 媒 扶 凡 抑 凩 嘲 孺 怡 掵 栲 毳 烋 痾 竈 繃 艟 蛩 諳 轗 閘 驀 黨 筎 螭 
0x7e  × ミ н 円 樫 救 鯨 降 止 淳 厨 掻 蓄 冬 梅 敷 盆 欲 凭 嘸 宀 恠 捫 桎 毯 烝 痿 窰 縷 艤 蛬 諧 轜 閙 驃 黯 螵