Solved

UTF-8 and wstring

Posted on 2014-12-02
4
168 Views
Last Modified: 2014-12-02
I've been thinking that UTF-8 is best represented in a wstring, but I've just come across a library that has turned my world upside down.  They use char* for UTF-8.  Apparently this is the way it's supposed to be?  If my existing libraries all use wstring for UTF-8, what are your recommendations for me?

Thanks!
Mike
0
Comment
Question by:thready
  • 2
  • 2
4 Comments
 
LVL 1

Author Comment

by:thready
Comment Utility
ok wow.. jkr  has not answered my question yet.  It must be that I'm not the only one that finds this confusing...!  :)
0
 
LVL 86

Accepted Solution

by:
jkr earned 500 total points
Comment Utility
Be careful what you are wishing for - UTF-8 (http://en.wikipedia.org/wiki/UTF-8) - as the name implies it *tries* to encode UNICODE to a 8-bit contained space, but that requires code points (http://en.wikipedia.org/wiki/Code_point) which are IMO basically a different expression for 'code pages'. So, in a nutshell: If you *need* UNICODE, there is no way around using UNICODE or at least UTF-16, then you *might* be sure that the character mappings will be somehow universal. If you can live with a subset of that (and UTF-8 does not even pretend to be anything else), it will be fine.
0
 
LVL 86

Assisted Solution

by:jkr
jkr earned 500 total points
Comment Utility
*LOL*
0
 
LVL 1

Author Closing Comment

by:thready
Comment Utility
Thanks jkr  :-)
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
The goal of this video is to provide viewers with basic examples to understand how to use strings and some functions related to them in the C programming language.
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use for-loops in the C programming language.

728 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now