Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Developing U++ » U++ Developers corner » about unicode supporting
about unicode supporting [message #59239] Thu, 01 December 2022 15:38 Go to next message
Satervalley is currently offline  Satervalley
Messages: 18
Registered: December 2022
Promising Member
I'm working on a app with upp under windows,as I want an "unicode built"(use -DUNICODE with clang or /D UNICODE with vc), but both have compiling error(upp core or ctrlcore packages), says that calling some wchar version function(xxxW()) with parameter of char *. I try UWord example, same error messages. how can I create an "unicode built" of my app?
Re: about unicode supporting [message #59246 is a reply to message #59239] Fri, 02 December 2022 20:55 Go to previous messageGo to next message
zsolt is currently offline  zsolt
Messages: 696
Registered: December 2005
Location: Budapest, Hungary
Contributor
U++ uses Unicode inside without any extra setting.
I'm using utf-8 in all off my sources and translation files and it works pretty well.
Re: about unicode supporting [message #59248 is a reply to message #59239] Sat, 03 December 2022 15:44 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Satervalley wrote on Thu, 01 December 2022 15:38
I'm working on a app with upp under windows,as I want an "unicode built"(use -DUNICODE with clang or /D UNICODE with vc), but both have compiling error(upp core or ctrlcore packages), says that calling some wchar version function(xxxW()) with parameter of char *. I try UWord example, same error messages. how can I create an "unicode built" of my app?


Technical/Win32 explanation: U++ is built without /D UNICODE, but when communicating with Win32, it is using "W" variants of functions.
Re: about unicode supporting [message #59257 is a reply to message #59248] Wed, 07 December 2022 02:45 Go to previous messageGo to next message
Satervalley is currently offline  Satervalley
Messages: 18
Registered: December 2022
Promising Member
thanks 4 replying. In fact, I'm confused on UPP's unicode handling, there's seems some inconsistent. 4 instance, SelectFileOpen()accept a const char* parameter and return String(that not good),imo that's not unicode friendly, ioh EditField ctrl SetText() accepts both String and WString(that's good), but GetText() only return WString.
Re: about unicode supporting [message #59259 is a reply to message #59257] Wed, 07 December 2022 09:37 Go to previous messageGo to next message
zsolt is currently offline  zsolt
Messages: 696
Registered: December 2005
Location: Budapest, Hungary
Contributor
Basically I use UTF-8 everywhere in my sources, and convert, if needed. This is the most convenient way, as it is the most portable encoding between platforms and libraries I use. In EditFields I use only SetData()/GetData() interface, as it stores Value and convert when needed.
This is quite useful, I think.
Re: about unicode supporting [message #59260 is a reply to message #59257] Wed, 07 December 2022 17:32 Go to previous message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Satervalley wrote on Wed, 07 December 2022 02:45
thanks 4 replying. In fact, I'm confused on UPP's unicode handling, there's seems some inconsistent. 4 instance, SelectFileOpen()accept a const char* parameter and return String(that not good),imo that's not unicode friendly, ioh EditField ctrl SetText() accepts both String and WString(that's good), but GetText() only return WString.


The idea is to prefer UTF-8 everywhere. Sometimes, some methods are better returning WString - e.g. as internal representation in EditField is WString, it is easier to have GetText returning this internal WString directly, without converting it into utf-8.

If function/method accepts const char * or String, it is usually UTF-8 (there are some exception, e.g. String is often used with binary data).

And, BTW, Unicode support at this moment is not perfect, but is has nothing to do with this (we are yet missing some advanced typography features like combination characters needed to support languages like bengali, also RTL support is missing - all this is planed)

[Updated on: Wed, 07 December 2022 17:35]

Report message to a moderator

Previous Topic: theide with libclang
Next Topic: clangd
Goto Forum:
  


Current Time: Thu Apr 18 03:29:30 CEST 2024

Total time taken to generate the page: 0.01854 seconds