Home » Community » U++ community news and announcements » Upp 2007.1beta released
Re: Upp 2007.1beta released [message #7756 is a reply to message #7750] |
Fri, 19 January 2007 14:53   |
 |
mirek
Messages: 14262 Registered: November 2005
|
Ultimate Member |
|
|
mobilehunter wrote on Thu, 18 January 2007 19:49 | For example i set the default charset for TheIDE is UTF-8.
Then i do some code editing, and put same japanese glyph.
What character code will TheIDE receive from the system, is it in Shift-JIS?
Because i think, when we do EnumFont, the AddFace will receive Shift-JIS code.
|
String FromSystemCharset(const String& src)
{
WStringBuffer b(src.GetLength());
int q = MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, ~src, src.GetLength(), (WCHAR*)~b, src.GetLength());
if(q <= 0)
return src;
b.SetCount(q);
return WString(b).ToString();
}
So we are using Win32 API function to translate system specific text (which is most likely in Shift-JIS, but we do not exactly have to care) to UNICODE and then to String using default encoding. Unfortunately, as default default encoding is win1252, unicode characters were lost.
Quote: |
What kind of process that TheIDE do to show it back to user at editor box?
|
Before being displayed by Win32 GDI, inverse process is used to convert String to UNICODE.
Quote: |
Which code that do translation from user keystroke to displaying it to editor box?
|
If Win32 supports unicode (Win98 does not!), windows are create using CreateWindowW API function and then WM_CHAR message come with UNICODE characters.
BTW, can you please test that my theory about no need of altering U++ library and just setting default charset to UTF-8 is correct?
Mirek
|
|
|
 |
|
Upp 2007.1beta released
By: unodgs on Tue, 16 January 2007 23:19
|
 |
|
Re: Upp 2007.1beta released
By: masu on Wed, 17 January 2007 11:01
|
 |
|
Re: Upp 2007.1beta released
By: mirek on Wed, 17 January 2007 11:36
|
 |
|
Re: Upp 2007.1beta released
By: Ulti on Thu, 18 January 2007 01:55
|
 |
|
Re: Upp 2007.1beta released
By: mirek on Thu, 18 January 2007 04:59
|
 |
|
Re: Upp 2007.1beta released
By: Ulti on Thu, 18 January 2007 07:27
|
 |
|
Re: Upp 2007.1beta released
|
 |
|
Re: Upp 2007.1beta released
|
 |
|
Re: Upp 2007.1beta released
By: mirek on Thu, 18 January 2007 18:32
|
 |
|
Re: Upp 2007.1beta released
|
 |
|
Re: Upp 2007.1beta released
By: mirek on Fri, 19 January 2007 14:53
|
 |
 |
Re: Upp 2007.1beta released
By: Novo on Thu, 18 January 2007 06:10
|
 |
|
Re: Upp 2007.1beta released
By: mirek on Thu, 18 January 2007 07:02
|
 |
|
Re: Upp 2007.1beta released
By: Novo on Fri, 19 January 2007 02:24
|
Goto Forum:
Current Time: Thu Jun 26 22:56:29 CEST 2025
Total time taken to generate the page: 0.11254 seconds
|