代码之家  ›  专栏  ›  技术社区  ›  David

c中变量的非拉丁名称#

c#
  •  1
  • David  · 技术社区  · 15 年前

    我已经命名我的按钮对象(WinForms)与所有希伯来文字母,然后添加点击事件。。。而且成功了。

    这是我错过的一些新功能吗?

    this.כפתור = new System.Windows.Forms.Button();
    this.SuspendLayout();
    // 
    // כפתור
    // 
    this.כפתור.Location = new System.Drawing.Point(58, 48);
    this.כפתור.Name = "כפתור";
    this.כפתור.Size = new System.Drawing.Size(75, 23);
    this.כפתור.TabIndex = 0;
    this.כפתור.Text = "button1";
    this.כפתור.UseVisualStyleBackColor = true;
    this.כפתור.Click += new System.EventHandler(this.button1_Click);
    
    private void button1_Click(object sender, EventArgs e)
    {
    כפתור.Text = "BLAH BLAH";
    }
    
    3 回复  |  直到 15 年前
        1
  •  6
  •   Stilgar    15 年前

    C#(也是Java等其他流行语言)使用unicode字符集作为源代码。这不是什么新鲜事。

    我建议你不仅要用英文字母,而且要用英文名字来识别。它使程序命名与框架保持一致,源代码可以由不懂您的语言的程序员维护。

        2
  •  0
  •   Colin Mackay    15 年前

    C语言规范显示了可以和不能用于标识符的内容。

    http://msdn.microsoft.com/en-us/library/aa664670%28v=VS.71%29.aspx

    它基本上说unicode字符允许用于某些字符集,我假设包含希伯来语的字符集在该列表中。(我不知道希伯来字符集的集合名称)

        3
  •  0
  •   Nostradamnit    15 年前

    看起来unicode变量名已经被支持了一段时间,尽管我从未使用过它们。 http://jameskovacs.com/2006/02/16/unicode-variable-names/