Results 1 to 2 of 2
  1. #1

    Member Since
    Jun 05, 2009
    mbtowc and extended/high ASCII
    I have a suite of programs that run on Windows and linux (redhat, fedora). My current task is to get them running on a mac running OS X.

    Internally the programs use wide characters/UTF-8. We need to be backwards compatible with a version of software that stored things in extended ascii (which I gather is also called high ascii).

    On fedora when I call mbtowc with a value between 128 and 255, I get the appropriate wide character. On the mac it fails. I *think* I found in sources that in Darwin, mbtowc considers only 0 to 127 to be valid ascii characters. Does anyone know for sure that this is true?

    Is there a different conversion I can use, or am I going to have to write my own mbtowc?



  2. #2

    Member Since
    Jun 05, 2009
    I will answer myself in case someone else ever needs to figure this out.

    On redhat and fedora systems, we're stripping the UTF-8 off our LC_TYPE if we detect that we need to do extended ascii. (For example, en_US.UTF-8 becomes en_US) On those systems our version(s) of libc can handle it.

    On our ancient solaris systems we have to set our locale to "C" and hope for the best. This is apparently what the mac needs. At least, it works well enough that I can move on to the next hurdle.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Formatting external HD - Extended or Extended Journalled
    By Psychotic_clown in forum Switcher Hangout
    Replies: 1
    Last Post: 08-07-2012, 02:06 PM
  2. ASCII characters
    By Doddster in forum Apple Desktops
    Replies: 2
    Last Post: 07-28-2010, 04:12 PM
  3. Issue with jpg looking like ASCII characters
    By cebo in forum Images, Graphic Design, and Digital Photography
    Replies: 4
    Last Post: 07-15-2010, 12:29 PM
  4. ASCII convertor
    By chihiro in forum macOS - Apps and Games
    Replies: 1
    Last Post: 11-21-2008, 03:53 PM
  5. ASCII art software
    By jongesla in forum macOS - Apps and Games
    Replies: 4
    Last Post: 02-21-2008, 03:54 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts