POV-Ray : Newsgroups : povray.off-topic : Unicode : Re: Unicode Server Time
4 Sep 2024 19:20:45 EDT (-0400)
  Re: Unicode  
From: TC
Date: 31 Jan 2010 21:10:32
Message: <4b663818$1@news.povray.org>
Hope the following helps:

Internally .net stores characters as unicode (UTF16). There is an "encoding" 
class that helps you to deal with encodings. Windows .net API provides you 
with the option to use many different character encodings.

Here some excerpts from the MS online help:

Dim fileReader As String
fileReader = My.Computer.FileSystem.ReadAllText("C:\test.txt", 
System.Text.Encoding.UTF32)
MsgBox(fileReader)

Writing goes something like this:

My.Computer.FileSystem.WriteAllText(file ,text ,append ,encoding)

There are a lot of different encodings supported by .net:

      ASCIIEncoding
     Represents an ASCII character encoding of Unicode characters.

      UnicodeEncoding
     Represents a UTF-16 encoding of Unicode characters.

      UTF32Encoding
     Represents a UTF-32 encoding of Unicode characters.

      UTF7Encoding
     Represents a UTF-7 encoding of Unicode characters.

      UTF8Encoding
     Represents a UTF-8 encoding of Unicode characters.



Chr uses the Encoding class in the System.Text namespace to determine if the 
current thread is using a single-byte character set (SBCS) or a double-byte 
character set (DBCS). It then takes CharCode as a code point in the 
appropriate set. The range can be 0 through 255 for SBCS characters 
and -32768 through 65535 for DBCS characters.

The returned value depends on the code page for the current thread, which is 
contained in the ANSICodePage property of the TextInfo class in the 
System.Globalization namespace. You can obtain ANSICodePage by specifying 
System.Globalization.CultureInfo.CurrentCulture.TextInfo.ANSICodePage.

ChrW takes CharCode as a Unicode code point. The range is independent of the 
culture and code page settings for the current thread. Values from -32768 
through -1 are treated the same as values in the range +32768 through 
+65535.

Numbers from 0 through 31 are the same as standard nonprintable ASCII codes. 
For example, Chr(10) returns a line feed character.


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.