Which programming languages were designed with Uni

2020-02-08 15:18发布

Which widely used programming languages were designed ground-up with Unicode support?

A lot of programming languages have added Unicode support as an afterthought in later versions, but which widely used languages were released with Unicode support from day one?

12条回答
一纸荒年 Trace。
2楼-- · 2020-02-08 15:32

Google's Go programming language supports Unicode and works with UTF-8.

查看更多
一纸荒年 Trace。
3楼-- · 2020-02-08 15:32

java and .net languages

查看更多
家丑人穷心不美
4楼-- · 2020-02-08 15:36

Java uses characters from the Unicode character set.

查看更多
狗以群分
5楼-- · 2020-02-08 15:38

Basically all of the .NET languages are Unicode languages, such as C# and VB.NET.

查看更多
Rolldiameter
6楼-- · 2020-02-08 15:38

I don't know how far this goes in other languages, but a fun thing about C# is that not only is the runtime (the string class etc) unicode aware - but unicode is fully supported in source:

using משליט = System.Object;
using תוצאה = System.Int32;
public class שלום : משליט  {
    public תוצאה בית() {
        int אלף = 0;
        for (int λ = 0; λ < 20; λ++) אלף+=λ;
        return אלף;
    }
}
查看更多
Root(大扎)
7楼-- · 2020-02-08 15:38

Java and the .NET languages, as other commenters have pointed out, although Java's strings are UTF-16 rather than UCS or UTF-8. (At the time, it seemed like a sensible idea! Now clearly either UTF-8 or UCS would be better.) And Python 3 is really a different, incompatible language from Python 1.x and 2.x, so it qualifies too.

The Plan9 languages around 1992 were probably the first to do this: their dialect of C, rc, Alef, mk, ACID, and so on, were all Unicode-enabled. They took the very simple approach that anything that wasn't ASCII was an identifier character. See their paper from 1993 on the subject. (This is the project where UTF-8 was invented, which meant they could do this in a pretty compatible way, in particular without plumbing binary-versus-text through all their programs.)

Other languages that support non-ASCII identifiers include current PHP.

查看更多
登录 后发表回答