[問題] unicode文件中隱形字元?
開發平台(Platform): (Ex: VC++, GCC, Linux, ...)
vs2012
額外使用到的函數庫(Library Used): (Ex: OpenGL, ...)
mfc
問題(Question):
解析字幕文字時候遇到unicode的隱形字元
餵入的資料(Input):
uni
https://dl.dropboxusercontent.com/u/17190710/uni.txt
ansi
https://dl.dropboxusercontent.com/u/17190710/ansi.txt
預期的正確結果(Expected Output):
解讀時、分、秒時候
開始秒應該是02
錯誤結果(Wrong Output):
但因為中間藏有一個隱形字元
所以變成只抓到0,後面的欄位也跟著跑掉
程式碼(Code):(請善用置底文網頁, 記得排版)
http://ideone.com/2jdcUC
補充說明(Supplement):
主要是 swscanf_s 解析buff時候被unicode中間的隱形字元打敗了
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 122.116.78.236
推
05/14 19:36, , 1F
05/14 19:36, 1F
→
05/14 19:37, , 2F
05/14 19:37, 2F
3q~看來沒有比較簡單的工具可以用 orz
※ 編輯: Achillean 來自: 122.116.78.236 (05/15 17:47)
C_and_CPP 近期熱門文章
PTT數位生活區 即時熱門文章