PDA

View Full Version : Proposed Wide String (Unicode) support in OxygenBasic



Charles Pegge
26-02-2011, 18:28
Proposal:

Attempting to keep it as transparent as possible so that Ascii strings and Wide Strings can be correctly combined or manipulated together.

New Types

wstring Wide dynamic string

Bstring2 Wide Bstring

Zstring2 Wide null-terminated string (terminated by 2 null bytes)


New String Functions:


Wchr(n) wide counterpert of chr(n)

Unic(s) Unic(s,n) wide counterpart of Asc(s) or Asc(n,i)

Wide string literals

w"this string has wide characters"
w`and so does this`

By using internal overloaded functions, I hope everything else can be handled automatically

Charles

Petr Schreiber
27-02-2011, 00:03
Hi Charles,

this proposal sounds great to me, especially the overloading part. I am looking forward to it :)

Will the w prefix for quotes be necessary even for case you assign to WString variable? I think in such a case it could be presumed as default you assign Unicode string.


Petr

Charles Pegge
27-02-2011, 04:08
Yes Petr,

Character width is automatically adjusted to the Type being used - whether wstring or string etc.

Wide Literals may still be necessary in some circumstances - low level coding for example, where there is no specified variable type.

Charles