Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8552637
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T14:28:03+00:00 2026-06-11T14:28:03+00:00

I have Unicode string and I want to compare with the following requirements. Confusable

  • 0

I have Unicode string and I want to compare with the following requirements.

Confusable s [1] character should be consider the same character,
example: T (LATIN CAPITAL LETTER T U 0054) should be == T (GREEK CAPITAL LETTER TAU U03A4) etc

(* [1] example http://unicode.org/cldr/utility/confusables.jsp?a=TESTt&r=None*)

http://www.unicode.org/Public/security/revision-03/confusablesSummary.txt

I will use the above file in order to make the code, but if there are already any free libraries I would prefer to use it.

I am thinking that the code would create a temporary ustring in which every confusable character would be replaced with the corresponding latin character.

In the real program I will be testing 10x5000x10000 strings containing one word each.

Test program:

 std::locale::global(std::locale(""));

 std::cout.imbue(std::locale());

 Glib::ustring s1,s2;

 s1="TEST";

 s2="TΕST";

 s1.normalize(Glib::NORMALIZE_NFKD    );

 s2.normalize(Glib::NORMALIZE_NFKD   );

 std::cout<<"1->true, 0->false  (s1==s2) =>  "<<(s1==s2)<<"\n";

Test program output:

1->true, 0->false  (s1==s2) =>  0

Ubuntu locale command Output:

Ubuntu 12.04 64 bit>$ locale  
LANG=en_US.UTF-8
LANGUAGE=
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=

Thank you for your time!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T14:28:05+00:00Added an answer on June 11, 2026 at 2:28 pm

    As user1675224 says you should be using ICU rather than attempting to roll your own algorithm.

    For example, to use uspoof_areConfusable:

    UErrorCode status = 0;
    USpoofChecker *sc = uspoof_open(&status);
    int result = uspoof_areConfusable(sc, s1.data(), s1.length(), s2.data(), s2.length(), &status);
    uspoof_close(sc);
    

    If you’re comparing large numbers of strings against each other, you should convert them to their skeletons using uspoof_getSkeleton, and put that in a set or hash set.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a unicode string for example u'Mar232012' . I want to convert it
I have a string with escaped Unicode characters, \uXXXX , and I want to
I have a Python Unicode string. I want to make sure it only contains
I have the following string stored in the database which is in Unicode format.
I have a Korean Unicode string ( ...입니다.<br /><br />소재... ) that I want
I want to iterate each character of a Unicode string, treating each surrogate pair
I have a string and I want to know if it has unicode characters
We have a user provided string that may contain unicode characters, and we want
For example, if I have a unicode string, I can encode it as an
I have a unicode string like '%C3%A7%C3%B6asd+fjkls%25asd' and I want to decode this string.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.