Thread: International Phonetic ALphabet in C

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Feb 2019
    Posts
    1,078
    Quote Originally Posted by christop View Post
    I've had to deal briefly with WCHAR and TCHAR strings in Windows. I imagine I'd develop PTSD if I had to do that on a regular basis.
    Well... I believe I would have some kind of brain injury if I had to deal with WINOWS in a regular basis... Take a look:
    Code:
    // test.c
    #include <windows.h>
    
    int main( void )
    {
      HANDLE hc;
      static const WCHAR msg1[] = L"\u20ac\n";  // EURO (U+20AC) -- ok!
      static const WCHAR msg2[] = L"\U0001d11e\n"; // SOL CLEEF (U+1D11E) -- doesn't work!
    
      hc = GetStdHandle( STD_OUTPUT_HANDLE );
      WriteConsoleW( hc, msg1, ( sizeof msg1 - 1 ) / sizeof msg1[0], NULL, 0 );
      WriteConsoleW( hc, msg2, ( sizeof msg2 - 1 ) / sizeof msg2[0], NULL, 0 );
    }
    Compiling with MSVC (to not have any doubt about this):

    International Phonetic ALphabet in C-untitled-png

    Seems WINDOWS don't deal very well with surrogates.
    Last edited by flp1969; 09-23-2022 at 03:02 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Hashing, indexing and phonetic normalization for approximate str matching...
    By biterman in forum A Brief History of Cprogramming.com
    Replies: 0
    Last Post: 11-21-2006, 09:42 AM
  2. International Limits on Precision
    By Davros in forum A Brief History of Cprogramming.com
    Replies: 1
    Last Post: 08-20-2004, 06:32 AM
  3. International Compliance, ugh!
    By Sebastiani in forum Windows Programming
    Replies: 1
    Last Post: 12-04-2002, 06:18 PM
  4. International (scandinavian) characters?
    By Unregistered in forum C++ Programming
    Replies: 3
    Last Post: 01-11-2002, 06:14 PM

Tags for this Thread