Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there a plan to switch from wxT("") to wxString::FromUTF8? #796

Open
alex290 opened this issue Nov 16, 2023 · 4 comments
Open

Is there a plan to switch from wxT("") to wxString::FromUTF8? #796

alex290 opened this issue Nov 16, 2023 · 4 comments

Comments

@alex290
Copy link

alex290 commented Nov 16, 2023

Hello, wxT("...") is everywhere in the code generator. In version 3.2, they removed it from the documentation on the forum, they wrote that they left it only for backward compatibility and recommend using wxString::FromUTF8 (https://docs.wxwidgets.org/3.2.4/overview_string.html). Is there a replacement planned in wxFormBuilder?

@Kumazuma
Copy link

Kumazuma commented Nov 23, 2023

I think that wxT should be replaced to wxS, not wxString::FromUTF8. https://docs.wxwidgets.org/3.2.4/group__group__funcmacro__string.html#ga0a06701ea0e6bb00c5171ace1b1f5691

@alex290
Copy link
Author

alex290 commented Jan 16, 2024

I think that wxT should be replaced to wxS, not wxString::FromUTF8. https://docs.wxwidgets.org/3.2.4/group__group__funcmacro__string.html#ga0a06701ea0e6bb00c5171ace1b1f5691

I agree, it is possible. Since the documentation recommends not using wxT

https://docs.wxwidgets.org/3.2.4/group__group__funcmacro__string.html#ga437ea6ba615b75dac8603e96ec864160

4FlpJau 1

@sodevel
Copy link
Member

sodevel commented Jan 24, 2024

What exactly do you mean by "is everywhere in the code generator"? The wxFB source code itself or the generated code?

When i am rewriting wxFB source code, i am removing wxT() when i encounter them or replace them with _(), because in many parts of the code these two marcos are used wrong and their usage needs to be switched.

In generated code you should rarely see this macro, unless you have disabled internationalization which you usually should not do. Although the wxWidgets documentation says you should not use this macro anymore, it also mentions a huge limitation if you do so: you should only use 7 bit characters. While this is not a big issue for the english language, it is for other languages.

I encountered many encoding related problems in the past, especially Windows is prone for such issues. Even in these days, the safest way to avoid them is using wide strings. Since wxT("") is nothing more than L"" today, i currently have no plans to switch from wxT() to anything else.

@alex290
Copy link
Author

alex290 commented Jan 24, 2024

I only meant code generation. As we wrote above, wxS("") is what wxWidgets recommend in the documentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants