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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T20:56:51+00:00 2026-05-21T20:56:51+00:00

I have a look up table for isAlpha. for (int i = 0; i

  • 0

I have a look up table for isAlpha.

for (int i = 0; i <= UCHAR_MAX; ++i)
p.isalphaLUT[i] = isalpha(i);

where isalphaLUT is a char array…The problem is isalphaLUT[i] where i is a character outside the ASCII range, (it prints 4294967168 when i attempt to get the equivalent ASCII value). I tried setting all ASCII ranges above 127 equal to 0, but that does not work. The character in question is this ö.

  • 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-05-21T20:56:51+00:00Added an answer on May 21, 2026 at 8:56 pm

    The correct way to test if a character is a letter is to test that it is in one of the letter categories: Lu, Ll, Lt, Lm, or Lo. You can use the ICU library from IBM to do this, it is a quite popular library for handling Unicode.

    http://icu-project.org/apiref/icu4c/uchar_8h.html

    You can also use the u_isalpha function from ICU directly, or u_charType to determine the category of a character. Note that the term “letter” is preferred to “alpha”, since there are many non-alphabetic “letters” in Unicode (such as Chinese characters).

    However, you must decode the character first. If you are using an array of char, then your encoding could be ASCII, LATIN-1, Windows 1252, UTF-8, or any of a zillion other encodings. If you access a char directly, it could be signed or unsigned depending on your platform, which is why you’d get an obviously wrong number like 4294967168 — which is just what happens when the byte 0x80 is interpreted as a signed char and then cast to an unsigned int.

    Using a lookup table is a very poor choice for this kind of task because the table would have to be so large — about 700k. Instead, I recommend either using ICU or creating a table of ranges of characters and performing a binary search in the table. This can be quite efficient.

    I am working on a tool to create exactly these kinds of tables. The tool is currently not ready for production, but if you’re adventurous you can use it, and the README has examples of how to use it.

    https://github.com/depp/uniset

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

Sidebar

Related Questions

I have this look up table : char *table[ascii][morse]; where ascii is an int
I have a table with rowID, longitude, latitude, businessName, url, caption. This might look
I have 2 tables which in simplified form look like this: Products( id: int,
let say i have table look like below actionTable ----------- id, user, actionName, time
What is the most efficient way to do look-up table in C# I have
I have look-up-table as defined below and I'm making use of GCC. When I
We are having 2 problem with jquery. Please have a look at the following...
I have a problem, I tried to look at almost all the poster solutions,
I have a number of tables with the same columns and it would look
Have a look at this very simple example WPF program: <Window x:Class=WpfApplication1.Window1 xmlns=http://schemas.microsoft.com/winfx/2006/xaml/presentation xmlns:x=http://schemas.microsoft.com/winfx/2006/xaml

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.