Unicode characters not showing in System.Windows.Forms.TextBox

前端 未结 3 966
慢半拍i
慢半拍i 2020-12-06 17:11

These characters show fine when I cut-and-paste them here from the VisualStudio debugger, but both in the debugger, and in the TextBox where I am trying to display this text

相关标签:
3条回答
  • 2020-12-06 17:50

    I was facing similar problem.

    It was problem with reading file properly and not with TextBox control.

    StreamReader reader = new StreamReader(inputFilePath, Encoding.Default, true)
    

    Copied from THIS.

    Works for me and that too without switching to RichTextBox.

    0 讨论(0)
  • 2020-12-06 17:53

    You need to install and use a font which supports those characters. Not all fonts support all characters. the [] box character is the fonts representation of 'unsupported'

    The textbox might be using MS Sans Serif by default, so change it to Arial or something else.

    0 讨论(0)
  • 2020-12-06 17:54

    I changed from using a TextBox to using a RichTextBox, and now the characters display in the RichTextBox.

    0 讨论(0)
提交回复
热议问题