[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

"modern" c++

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 17
Thread images: 1

File: logo-sun.jpg (20KB, 360x193px) Image search: [Google]
logo-sun.jpg
20KB, 360x193px
> 2k17
> trying to compete with modern languages in terms of system programming, embedded systems etc.
> still no good support for unicode
> trying to write an app for laboratories
> lab guy demands my language special characters
> ends up with fucking random bytes being written into the terminal

Why doesn't c++ standard comitee make a support for unicode. I wouldn't demand it everywhere. Just one lib or something
>>
Just say goodbye to your stupid niggerrunes and embrace the american alphabet already.

[code}//WONTFIX[/code]
>>
>>60277868
OP specifically mentioned a laboratory so it's easy to assume that they need special scientific symbols and that you're a retard.
>>
>>60277822
>> trying to compete with modern languages in terms of system programming, embedded systems etc.
Are you claiming it doesn't?
>> still no good support for unicode
What are you talking about? U"string" works fine.
>> ends up with fucking random bytes being written into the terminal
That is on you.
>>
>>60277822
>lab
>programming scientists
the problem is you
>>
>>60277909
utf8 is u8"string"
http://en.cppreference.com/w/cpp/language/string_literal
>>
i know that if I std::cin>> and then std::cout it will be fine, but if I hardcode some special character into wstring, u8string etc. it doesn't work.

and maybe it works if you spend some time figuring out how to do it, but if you are some beginner and u want to just cout what you want to cout, its annoying
>>
>>60278044
woah hold on.
that would require opie to have basic knowledge of the language
>>
>>60277822
>Why doesn't c++ standard comitee make a support for unicode.
Basically, because natural language is hard and naive abstractions around it break down horribly. Any attempt to set in stone a standard library would be very likely to end in tears.
>>
>>60278294
can you post the string you are trying to write and how you plan to print them?
>>
>>60277822
how do i git gud in c++?
What books would you recomend?
>>
>>60277822

I never had any problems.

- If I use UTF-8 in ordinary string literals, they always work -- even without using the u8 string prefix. You just need to have a code editor that supports UTF-8, like vim.

- I make sure that all data files use UTF-8 for strings. When I read them into char* strings, they're also UTF-8 internally.

- We've had UTF-8 support in <stdlib.h> going all the way back to C89: see mblen(), mbstowcs() and so forth. (Although I never had a need to use them, because it's so easy to just keep everything in UTF-8 strings everywhere, no need for conversions.)

I've worked extensively with UTF-8 strings in text files, data files, databases, network protocols, GUI, etc. for years and I have not had a single problem with it. The apps were fully internationalized, and we never advanced past C++98 and C99.

UTF-8 basically Just Works in C/C++.
>>
>>60277822
>Why doesn't c++ standard comitee make a support for unicode.

Because C++ is based on C, and C originally had full support for UTF-8, and UTF-8 fully supports Unicode. Therefore, there was no need for C++ to do anything to support Unicode, because support was automatically there from the beginning.

In fact, that was the whole design goal of UTF-8 -- to give C immediate and automatic support for MBS (which is the generic category of encodings that Unicode belongs to), by ensuring compatibility with the char* data type.
>>
>>60278523
>Basically, because natural language is hard and naive abstractions around it break down horribly. Any attempt to set in stone a standard library would be very likely to end in tears.

And yet, we have plenty of programming languages that offer full support for Unicode. The Unicode libraries for those languages are set in stone -- and somehow magically they were able to accomplish that feat without any tears. Amazing, isn't it?
>>
>>60279455
C++ has unicode support.
Read the thread nigger.
>>
>>60278294
never had issues with std::wstring
you can also use QString from Qt, its part of the Qt core so only 1 dll is needed for distribution.

Qt core also provides a lot of other utilities.
>>
>>60278316
And yet all the string functions still operate on single byte characters. Not really what one can call unicode support.
Thread posts: 17
Thread images: 1


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.