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 8708821
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T04:13:33+00:00 2026-06-13T04:13:33+00:00

Possible Duplicate: Javascript: Unicode string split by chars I have a javascript string which

  • 0

Possible Duplicate:
Javascript: Unicode string split by chars

I have a javascript string which contains some tamil characters. I need to split them into individual unicode characters. The split method does not understand the http://en.wikipedia.org/wiki/Complex_text_layout Complex text layout.

For example:

Calling split(“”) on “கதிரவன்” returns:

,க,த,ி,ர,வ,ன,்

when I expected:

க,தி,ர,வ,ன்

What should be done to split unicode characters from a string properly ?

Edit: I can navigate these letters just fine in the browser (chrome). I am trying to use this js in a chrome extension. So I am fine if there is a chrome-specific solution too.

  • 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-13T04:13:34+00:00Added an answer on June 13, 2026 at 4:13 am

    This is totally doable.

    First off, you create a set/dictionary which includes all diacritic-like characters as keys, we could name it as diacritics, and implement it just with a object literal:

    var diacritics = {'\u0bbf':true,'\u0bcd':true,...};
    

    Then do this:

    var tempList = "கதிரவன்".split('');
    var targetList = [];
    for(var idx in tempList){
      if(diacritics[tempList[idx]])
        targetList[targetList.length - 1] +=  tempList[idx];
      else
        targetList.push(tempList[idx]);
    }
    

    We don’t even need a tempList, just loop over the str char by char will do the job:

    for(var i = 0; i != str.length; ++i){
      var ch = str[i];
      diacritics[ch] ? (targetList[targetList.length - 1] += ch) : targetList.push(ch);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: JavaScript: string contains I have a postcode variable and want to use
Possible Duplicate: JavaScript Split without losing character I have a string: <foo>abcdefg</bar><foo>abcdefg</bar><foo>abcdefg</bar><foo>abcdefg</bar> I want
Possible Duplicate: JavaScript replace all / with \ in a string? I have a
Possible Duplicate: Javascript: strip out non-numeric characters from string String matching is headache for
Possible Duplicate: JavaScript: string contains Jquery: How to see if string contains substring In
Possible Duplicate: JavaScript Variable inside string without concatenation - like PHP In PHP, double
Possible Duplicate: JavaScript: formatting number with exactly two decimals Can some one please help
Possible Duplicate: JavaScript === vs == : Does it matter which “equal” operator I
Possible Duplicate: JavaScript Function Definition in ASP User Control Hi, I have a generic
Possible Duplicate: javascript - check if string begins with something? I've read in this

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.