Solved

utf8everywhere.org

Posted on 2014-12-14
11
155 Views
Last Modified: 2015-05-04
Hi experts,
Does anyone here follow the utf8everywhere.org manifesto for how to do Unicode and text properly on Windows?  I.e., they say that you should not use wstring, refrain from using L"", there are a bunch of strict rules to follow to create cross platform code.  I'm wondering if I want to go through the pains of rewriting some libraries to do this...  opinions and help and comments please! :-)

For sure my ultimate goal is to do cross platform world wide software...  but not if it puts me in a depression and prevents me from getting anything done...

Thanks,
Mike
0
Comment
Question by:thready
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 4
11 Comments
 
LVL 19

Assisted Solution

by:mrwad99
mrwad99 earned 333 total points
ID: 40501095
I worked at a company that did heavyweight MFC software, and we used UNICODE and the _T macro everywhere.  And they were doing that for years before I joined.  It never caused any issues.

SetWindowText is actually SetWindowTextA or SetWindowTextW, depending on whether UNICODE is defined.  So I don't quite see the problem the author of that page has with it...

I can't comment on what will be standard in years to come, only what has been standard recently.  Overall, if I was still writing MFC apps, I would still be using _T et al...

Other's opinions may vary though, it would be interesting to hear those...
0
 
LVL 1

Author Comment

by:thready
ID: 40501546
It doesn't sound like the code was cross platform though right?
0
 
LVL 19

Assisted Solution

by:mrwad99
mrwad99 earned 333 total points
ID: 40502338
The apps weren't cross platform.

I've read the article linked from this site (http://www.joelonsoftware.com/articles/Unicode.html) which makes some good points.  After this, I re-read utf8everywhere.org and it made more sense, with compelling arguments.

I wouldn't feel comfortable recommending you follow the advice on this site as I haven't done so myself.  What I would recommend is researching more into software internationalisation with C++ to get a better feel for it,  Additionally, with any luck other experts will be along here to give input on what is evidently a complex topic.
0
[Live Webinar] The Cloud Skills Gap

As Cloud technologies come of age, business leaders grapple with the impact it has on their team's skills and the gap associated with the use of a cloud platform.

Join experts from 451 Research and Concerto Cloud Services on July 27th where we will examine fact and fiction.

 
LVL 1

Author Comment

by:thready
ID: 40502350
Yep, I've read that one too.  It certainly is a complex topic.  It's sad that we still have these issues.  I really need to get to the bottom of this.
0
 
LVL 19

Expert Comment

by:mrwad99
ID: 40502358
If you want to do cross-platform stuff, then since the advice on that site is targeted at Windows it isn't necessarily the best thing to be looking at.

What kind of software are you writing, and what is the functionality of the libraries you say you would need to rewrite?
0
 
LVL 1

Author Comment

by:thready
ID: 40502398
The advice on that site doesn't seem to be targeted at windows- they appear to be making a real effort to get people to agree on how everyone should be storing strings.

My own libraries are the ones I would need to rewrite.  I'm most interested at the moment in writing cross platform SQLite use the Kompex library, but that's the tip of the iceberg.  I need to build up my libraries again and have something that is simultaneously being developed cross platform.  I never want to touch this code again basically.
0
 
LVL 19

Expert Comment

by:mrwad99
ID: 40502417
I would suggest requesting attention to this question (link at top) to get more input from others, as I have reached the end of my (limited) knowledge on this I am afraid...
0
 
LVL 1

Author Comment

by:thready
ID: 40515444
I would like to leave this one open.  I do believe it's probably one of the most important topics to advance in computer science.  If we can't truly reuse what we do, we're never advancing as a whole and we're wasting our time with every added function in the future by duplicating work, bugs, etc.  Everything we do should be cross platform.  At least, that's what is true in an ideal world.  To be cross platform, one has to think about just about every aspect of the final product:  the native user-interface which should not be cross-platform for obvious reasons, some common cross-platform business logic, and the "how do they talk to each other" interface.  That separation does not include the encoding logic, so an encoding map needs to be known for each operating system call/API pair between common base code and the layer that separates the specific native code.  All common code uses UTF-8, making conversions only where absolutely necessary.  Each component should always only ever encode their strings in one way, but there are probably libraries out there that can easily produce inconsistent encodings.  I think I may have answered my own question here.  There's probably no other way to do this than to clearly think about all the necessary separations - and even sometimes unfortunately discover that the underlying libraries you've chosen, are also going to be the source of your headaches with unicode or cross-platform"ness".
0
 
LVL 40

Accepted Solution

by:
evilrix earned 167 total points
ID: 40758993
Interestingly enough (and quite unrelated) I just wrote an article about my thoughts on Microsoft's flirtations with "Unicode".

http://www.experts-exchange.com/articles/18363/When-is-Unicode-not-Unicode-When-Microsoft-gets-involved.html

Basically, my view is, always use UTF8 if your code stands any chance what so ever of being ported from Windows. In fact even if it doesn't, use UTF8 internally and only convert to UTF16 when you absolutely have to. Avoid UTF16 like the plague because - well, that's exactly what it is! There's a good reason why all other sensible OSs use UTF8, because it's the only sensible and portable character encoding to use.

Microsoft jumped on the bandwagon of UTF16 without really thinking through the consequences. They have also brainwashed millions of Windows software engineers into thinking Unicode is something it is not.
0
 
LVL 1

Author Closing Comment

by:thready
ID: 40759144
Thanks everyone
0

Featured Post

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
In this post we will learn different types of Android Layout and some basics of an Android App.
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…

617 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question