mkdir() function reads arabic language wrong ?! please help

Discussion in 'PHP' started by free-designer, Feb 21, 2011.

  1. #1
    Hello everyone,
    uhm i got a problem with Rename() and mkdir() functions. this issue is all about file system management.

    Well i use mkdir and rename functinos for another language which is arabic, but the porblem is when i use mkdir or rename like the following

    
        mkdir( "path/to/folder/اسم المجلد" );
    
    PHP:
    Well this word "اسم المجلد" is arabic language and when the folder get created , it get saved like this "ط§ط³ظ… ط§ظ„ظ…ط¬ظ„ط¯" Well it seems wired because it should be saved like that "اسم المجلد", dose that mean that all PHP file system functions doesn't read arabic language i mean UTF-8 or what??

    please someone solve this problem for me.
    if u guys don't understand me well just tell me so i can explain more

    Thanks a lot guys =)
     
    free-designer, Feb 21, 2011 IP
  2. TimK

    TimK Peon

    Messages:
    51
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Try setting the locale to arabic using:
    
    setlocale(LC_ALL, 'ar');
    
    PHP:
    I've never had this sort of problem before so I'm not sure if this will reconcile the problem but it's worth a try.
     
    TimK, Feb 21, 2011 IP
  3. ThePHPMaster

    ThePHPMaster Well-Known Member

    Messages:
    737
    Likes Received:
    52
    Best Answers:
    33
    Trophy Points:
    150
    #3
    Make sure that the file you are calling this save from is saved in UTF-8 format (using notepad or Dreamweaver).

    If you are getting the names from the DB, make sure you query "SET NAMES `utf8`" before making the fetch/save queries.
     
    ThePHPMaster, Feb 21, 2011 IP