The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
 All Forums
 Origin Forum for Programming
 Forum for Origin C
 How to count wide characters in a string

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
flycs99 Posted - 06/13/2020 : 9:41:19 PM
For example:
sting str="ああ";
printf("%d\n",str.Count('あ'));


The return value is 0.

According to https://www.originlab.com/doc/OriginC/ref/string-Count,wide characters are supported.
Please help me to count the wide characters.
4   L A T E S T    R E P L I E S    (Newest First)
flycs99 Posted - 07/01/2020 : 01:42:37 AM
quote:
Originally posted by EleanorGagne

quote:
Originally posted by flycs99

For example:
sting str="ああ";
printf("%d\n",str.Count('あ'));
https://texttospeech.onl
https://mortgagecalculator.tech

The return value is 0.

According to https://www.originlab.com/doc/OriginC/ref/string-Count,wide characters are supported.
Please help me to count the wide characters.


size_t strlen(
const char *str
);
size_t wcslen(
const wchar_t *str
);
size_t _mbslen(
const unsigned char *str
);
size_t _mbslen_l(
const unsigned char *str,
_locale_t locale
);
size_t _mbstrlen(
const char *str
);
size_t _mbstrlen_l(
const char *str,
_locale_t locale
);


Thank you for your reply. This solution is very helpful and I can really get everything in the wide character strings. I will find the originC files for these functions.
flycs99 Posted - 07/01/2020 : 01:24:18 AM
quote:
Originally posted by cpyang

That documentation page might be wrong, or out dated, since Origin has been changed to use Unicode, UTF8. We updated Labtalk to properly handle Unicode, but OriginC was not updated for that.

Best will be to code in Python in Origin. We are making a lot of improvement in this area, you can request a beta of 2021 try out Python.

CP




Thank you for your reply. It is helpful. I will try python.
EleanorGagne Posted - 06/30/2020 : 12:35:06 AM
quote:
Originally posted by flycs99

For example:
sting str="ああ";
printf("%d\n",str.Count('あ'));
https://texttospeech.onl

The return value is 0.

According to https://www.originlab.com/doc/OriginC/ref/string-Count,wide characters are supported.
Please help me to count the wide characters.


size_t strlen(
const char *str
);
size_t wcslen(
const wchar_t *str
);
size_t _mbslen(
const unsigned char *str
);
size_t _mbslen_l(
const unsigned char *str,
_locale_t locale
);
size_t _mbstrlen(
const char *str
);
size_t _mbstrlen_l(
const char *str,
_locale_t locale
);
cpyang Posted - 06/14/2020 : 4:56:49 PM
That documentation page might be wrong, or out dated, since Origin has been changed to use Unicode, UTF8. We updated Labtalk to properly handle Unicode, but OriginC was not updated for that.

Best will be to code in Python in Origin. We are making a lot of improvement in this area, you can request a beta of 2021 try out Python.

CP

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000