patchDotGNU Portable.NET - Patches: patch #3562, Add Unicode support to Xsharp when...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

patch #3562: Add Unicode support to Xsharp when using Xft

Submitter:  Marc Haisenko <darkdust>
Submitted:  Wed 08 Dec 2004 02:37:06 PM UTC
   
 
Category:  None Priority:  4
Status:  Done Privacy:  Public
Assigned to:  None Open/Closed:  Closed

Discussion

Wed 08 Dec 2004 04:24:03 PM UTC, comment #1: 

Applied to CVS on 8th Dec 2004.

Gopal.V <t3rmin4t0r>
Group administrator
Wed 08 Dec 2004 02:37:06 PM UTC, original submission:  

This patch adds Unicode support to Xsharp when using Xft.

The patch converts strings into wide char strings (32 bit characters) using mbstowcs, which seems to be part of the C89 and UNIX98 / Single UNIX Specifications and thus should be avaible on all Unices. A quick google says it is also avaible on Mac OS X (being a BSD) and Windows / Visual Studio 6, so this should be pretty portable.

Configure checks for mbstowcs, #ifdef's have been used to guard the use of mbstowcs so the code works like it did before on system that don't have mbstowcs.

The original version of this patch used mbsrtowcs but while adding the #ifdef guards I found that supporting both mbsrtowcs and mbstowcs would result in very ugly code (way too many #if's). I think maintainable code is more important than the two or three cycles that mbsrtowcs could save. Of course I could add support for both mbsrtowcs and mbstowcs if other developers say it IS worth the three saved cycles ;-)

This patch has a problem, though: mbstowcs is dependent on the locale settings. If the locale is set to C or POSIX you won't get Unicode characters as these two locales just use the 7bit US-ASCII character space. All other locales work on Linux because they all derive from the "i18n" locale in the glibc. I don't know if mbstowcs does The Right Thing (tm) on non-glibc systems as well.

Marc Haisenko <darkdust>
Group Member

 

Attached Files

Attached Files
file #8148:  Xsharp.Unicode.patch added by darkdust (4.0KiB - text/x-diff)

 

Dependencies

This item does not depend on any other items.

No items depend on this one.

 

Mail Notification Carbon-Copy List

 

Votes

There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

 

History

Follow 3 latest changes.

Date Changed by Updated Field Previous Value => Replaced by
2004-12-08 t3rmin4t0r StatusNone Done
    Open/ClosedOpen Closed
2004-12-08 darkdust Attached File- Added Xsharp.Unicode.patch, #3931

Back to the top

Powered by Savane 3.16.
Corresponding source code