Unicode strings: Difference between revisions

Line 1,289:
Vala strings are UTF-8 encoded by default. In order to print them correctly on the screen, use stdout.printf instead of print.
<lang vala>stdout.printf ("UTF-8 encoded string. Let's go to a café!");</lang>
 
=={{header|Visual Basic .NET}}==
See the C# for some general information about the .NET runtime.
Below is an example of certain parts based of the information in the D entry.
<lang>Module Module1
 
Sub Main()
Console.OutputEncoding = Text.Encoding.Unicode
 
' normal identifiers allowed
Dim a = 0
' unicode characters allowed
Dim δ = 1
 
' ascii strings
Console.WriteLine("some text")
' unicode strings strings
Console.WriteLine("こんにちは")
Console.WriteLine("Здравствуйте")
Console.WriteLine("שלום")
' escape sequences
Console.WriteLine(vbTab + "text" + vbTab + ChrW(&H2708) + """blue")
Console.ReadLine()
End Sub
 
End Module</lang>
{{out}}
<pre>some text
こんにちは
Здравствуйте
שלום
text ✈"blue</pre>
 
=={{header|WDTE}}==
1,452

edits