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 » U++ Library support » U++ Core » [SOLVED] String.GetCount with umlaut
Re: String.GetCount with umlaut [message #33714 is a reply to message #33707] Wed, 07 September 2011 09:47 Go to previous messageGo to previous message
mr_ped is currently offline  mr_ped
Messages: 826
Registered: November 2005
Location: Czech Republic - Praha
Experienced Contributor
UTF8 is multibyte encoding with variable length for different characters.

IMHO the most correct solution for you is to convert from UTF8 to WString (UCS2), which should be well enough to cover *all* latin-like alphabets, Russian's azbuka as well and some more. (I'm afraid UCS2 does not cover all Chinese characters/etc.. no time to google Wink). Then work with WString to count characters, etc..

edit: Mirek beat me...

Quote:

(Anyway, thinking about it, perhaps I shall add "GetCharCount()" method to String...).


Indeed for sure, actually UTF8 would love to have full set of functions like len/right/left/mid/etc.. whenever number of characters (position) is used as parameter. Plus special section in documentation to explain it. Wink Very Happy

[Updated on: Wed, 07 September 2011 09:49]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Array : swapping element with a pointer
Next Topic: Core: Null handling incoherent?
Goto Forum:
  


Current Time: Tue Aug 26 21:09:10 CEST 2025

Total time taken to generate the page: 0.05575 seconds