Opening files with UNICODE file names

This is a discussion on Opening files with UNICODE file names within the Linux Programming forums, part of the Platform Specific Boards category; Hi all, I would like to know how to open files with UNICODE file names. Is there any function that ...

  1. #1
    Registered User
    Join Date
    Nov 2006
    Posts
    3

    Opening files with UNICODE file names

    Hi all,

    I would like to know how to open files with UNICODE file names. Is there any function that accepts a wchar_t as file name and returns a file descriptor of that file?

    Thanks,
    Alan

  2. #2
    Registered User Jaqui's Avatar
    Join Date
    Feb 2005
    Posts
    416
    if your linux system is configured to support unicode, then the standard file open will handle the filename.

    most linux systems can easily have unicode set as default charset, so everything on the system is encoded in unicode.
    [ lord knows all my linux boxes are unicode only, it helps with deciphering those ms codepage encoded crap files ]
    Quote Originally Posted by Jeff Henager
    If the average user can put a CD in and boot the system and follow the prompts, he can install and use Linux. If he can't do that simple task, he doesn't need to be around technology.

  3. #3
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,893
    Unicode is just a name for a group of standards, despite MS's use of the word. What is known as Unicode in Windows is really just the UCS-2 (I think, or perhaps UTF-16) encoding of the Unicode character set.

    Under *nix, the typical Unicode encoding used is UTF-8, a variable size encoding using a single byte as the base unit (a char, unlike UCS-2, which uses a wchar_t). The wchar_t in *nix is typically actually a 32-bit value and uses the UTF-32 encoding by default.

    On the other hand, I believe wxWidgets uses UCS-2 or UTF-16 in its APIs, as might some other wrapper libraries. GTK+ uses GLib's UTF-8 string types. Qt is annoyingly vague about the encoding it uses (it keeps referring to it as "Unicode encoding" in the 3.1 docs), but as far as I can see it's UCS-2 or UTF-16 - a QChar is 16 bits wide.

    So, what do you want?
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. File transfer- the file sometimes not full transferred
    By shu_fei86 in forum C# Programming
    Replies: 13
    Last Post: 03-13-2009, 01:44 PM
  2. Searching Binary Files for a Pattern
    By CaptainMorgan in forum C Programming
    Replies: 16
    Last Post: 06-17-2007, 07:04 PM
  3. Basic text file encoder
    By Abda92 in forum C Programming
    Replies: 15
    Last Post: 05-22-2007, 02:19 PM
  4. Unknown Memory Leak in Init() Function
    By CodeHacker in forum Windows Programming
    Replies: 3
    Last Post: 07-09-2004, 10:54 AM
  5. System
    By drdroid in forum C++ Programming
    Replies: 3
    Last Post: 06-28-2002, 11:12 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21