Page 1 of 2 12 LastLast
Results 1 to 15 of 16

Thread: Mod-rewrite url character problem

  1. #1
    Morphe is offline Registered User
    Join Date
    Mar 2008
    Posts
    12

    Question Mod-rewrite url character problem

    Wait wait ..
    And now v6 is available but character problems are available too.

    I have 6 different characters in Turkish;
    ı , İ , ş , Ş , ü , Ü , ö , Ö , ç , Ç , ğ , Ğ

    I want to change these charactes in the url with;
    i , I , s , S , u , U , o , O , c , C , g , G

    Is this code ok in lib/misc.lib.php ???

    $string = str_replace('ı', 'i', $string);
    $string = str_replace('İ', 'I', $string);
    $string = str_replace('ş', 's', $string);
    $string = str_replace('Ş', 'S', $string);
    $string = str_replace('ü', 'u', $string);
    $string = str_replace('Ü', 'U', $string);
    $string = str_replace('ö', 'o', $string);
    $string = str_replace('Ö', 'O', $string);
    $string = str_replace('ç', 'C', $string);
    $string = str_replace('Ç', 'C', $string);
    $string = str_replace('ğ', 'g', $string);
    $string = str_replace('Ğ', 'G', $string);

    I think, this is not enough. I've tried that but no action.

    Example:

    Code:
    http://dizin.acenteonline.com/sigorta-a%9eirketleri/aca%b1badem-saayla%b1k-ve-hayat-sigorta-a-a%9e/
    It must be;

    Code:
    http://dizin.acenteonline.com/sigorta-sirketleri/acibadem-saglik-ve-hayat-sigorta-a-s/
    My lib/misc.lib.php

    .
    .
    .
    // replace western chars with latin

    $string = str_replace(GetWestern('a'), 'a', $string);
    $string = str_replace(GetWestern('i'), 'i', $string);
    $string = str_replace(GetWestern('u'), 'u', $string);
    $string = str_replace(GetWestern('e'), 'e', $string);
    $string = str_replace(GetWestern('o'), 'o', $string);
    $string = str_replace(GetWestern('c'), 'c', $string);
    $string = str_replace(GetWestern('d'), 'd', $string);
    $string = str_replace(GetWestern('y'), 'y', $string);
    $string = str_replace(GetWestern('n'), 'n', $string);

    $string = str_replace('ı', 'i', $string);
    $string = str_replace('İ', 'I', $string);
    $string = str_replace('ş', 's', $string);
    $string = str_replace('Ş', 'S', $string);
    $string = str_replace('ü', 'u', $string);
    $string = str_replace('Ü', 'U', $string);
    $string = str_replace('ö', 'o', $string);
    $string = str_replace('Ö', 'O', $string);
    $string = str_replace('ç', 'C', $string);
    $string = str_replace('Ç', 'C', $string);
    $string = str_replace('ğ', 'g', $string);
    $string = str_replace('Ğ', 'G', $string);

    .
    .
    .
    .

  2. #2
    dody is offline Administrator
    Join Date
    Aug 2001
    Location
    Indonesia
    Posts
    3,731

    Default

    Try this:
    - do not make changes with /lib/misc.lib.php as above, restore to original file
    - edit /lib/western_chars.php, add above characters into appropriate latin characters

    $western_chars['a'] = array('*','À','á','Á','â','Â','ã','Ã','Ä' ,'ä','å','Å','æ','Æ');

    $western_chars['i'] = array('ì','Ì','*','Í','î','Î','Ï','ï');

    $western_chars['u'] = array('ù','Ù','ú','Ú','û','Û','Ü','ü');

    $western_chars['e'] = array('è','È','é','É','ê','Ê','Ë','ë');

    $western_chars['o'] = array('ò','Ò','ó','Ó','ô','Ô','õ','Õ','Ö' ,'ö','œ','Œ','ø','Ø');

    $western_chars['y'] = array('ý','Ý','Ÿ','ÿ');

    $western_chars['n'] = array('ñ','Ñ');

    $western_chars['d'] = array('ð','Ð');

    $western_chars['c'] = array('ç','Ç');

  3. #3
    Morphe is offline Registered User
    Join Date
    Mar 2008
    Posts
    12

    Default

    Sorry,
    I've changed /lib/western_chars.php like below;

    <?

    $western_chars['a'] = array('*','À','á','Á','â','Â','ã','Ã','Ä' ,'ä','å','Å','æ','Æ');
    $western_chars['i'] = array('ì','Ì','*','Í','î','Î','Ï','ï','İ');
    $western_chars['u'] = array('ù','Ù','ú','Ú','û','Û','Ü','ü');
    $western_chars['e'] = array('è','È','é','É','ê','Ê','Ë','ë');
    $western_chars['o'] = array('ò','Ò','ó','Ó','ô','Ô','õ','Õ','Ö' ,'ö','œ','Œ','ø','Ø');
    $western_chars['y'] = array('ý','Ý','Ÿ','ÿ');
    $western_chars['n'] = array('ñ','Ñ');
    $western_chars['d'] = array('ð','Ð');
    $western_chars['c'] = array('ç','Ç');

    $western_chars['s'] = array('ş','Ş');
    $western_chars['g'] = array('ğ','Ğ');

    ?>

    It's not working. http://dizin.acenteonline.com
    Last edited by Morphe; 05-12-2008 at 05:03 PM.

  4. #4
    Bruceper is offline Active Member
    Join Date
    Jun 2002
    Location
    Winnipeg Canada
    Posts
    4,913

    Default

    Believe it or not, you have multiple character codes in what you posted which is probably causing the issue.

    All characters need to be written in the same character code.

    ('ş <- your quote ' is in Unicode 15F for one example, I suspect this is because of your operating system. Try and use an editor that will allow you to view character codes for each character such as editplus or textpad.

  5. #5
    dody is offline Administrator
    Join Date
    Aug 2001
    Location
    Indonesia
    Posts
    3,731

    Default

    the western_char.php is in ANSI code. It's safer to use notepad and with your turkish keyboard to write: Ğ, ğ, İ, ı, Ş, ş

    If you send me above characters in ANSI plain text file, i'll update the code for you.
    I browsed websites, but most of them use utf8

  6. #6
    Morphe is offline Registered User
    Join Date
    Mar 2008
    Posts
    12

    Default

    Ok, realy interesting. I'm going to try again with notepad.
    I used dreamw. yesterday. You are right, it uses utf8 for default encoding.

  7. #7
    Morphe is offline Registered User
    Join Date
    Mar 2008
    Posts
    12

    Default This is a confession

    Yes, this is a confession. I can't use notepad

    Dody, tr.txt in the attachments. Please?

    And Bruce, I believe
    Attached Files Attached Files
    Last edited by Morphe; 05-13-2008 at 04:09 AM.

  8. #8
    dody is offline Administrator
    Join Date
    Aug 2001
    Location
    Indonesia
    Posts
    3,731

    Default

    Thanks, but that file content is
    ý
    Ý
    þ
    Þ
    ü
    Ü
    ö
    Ö
    ð
    Ð

    ? should it be new s, g, and i replacement?

  9. #9
    Morphe is offline Registered User
    Join Date
    Mar 2008
    Posts
    12

    Default

    I've saved the file with two different format ( ansi - utf8 ) and added a screenshot. File content is below too. Thanks again

    ı -> i
    İ -> i
    ş -> s
    Ş -> s
    ü -> u
    Ü -> u
    ö -> o
    Ö -> o
    ğ -> g
    Ğ -> g
    Attached Images Attached Images
    Attached Files Attached Files

  10. #10
    dody is offline Administrator
    Join Date
    Aug 2001
    Location
    Indonesia
    Posts
    3,731

    Default

    To let you know that, the first time I download the attached file above, it display wrong character again I even tried with 3 different os (ubuntu, xp, vista) but still wrong

    But then I tried to change xp language and keyboard to turkish and it work

    Ok, here is, try to upload in /lib folder, and let me know if it work, I will update svn too.
    Attached Files Attached Files

  11. #11
    Morphe is offline Registered User
    Join Date
    Mar 2008
    Posts
    12

    Default

    Thanks Dody. I've updated two files. Did you test it? http://dizin.acenteonline.com/

    I'm going to resign to speak Turkish. But I don't know another language
    Attached Images Attached Images
    Last edited by Morphe; 05-15-2008 at 04:56 AM.

  12. #12
    Bobi is offline Registered User
    Join Date
    Dec 2006
    Posts
    103

    Default

    Quote Originally Posted by Morphe View Post
    Sorry,
    I've changed /lib/western_chars.php like below;

    <?

    $western_chars['a'] = array('*','À','á','Á','â','Â','ã','Ã','Ä' ,'ä','å','Å','æ','Æ');
    $western_chars['i'] = array('ì','Ì','*','Í','î','Î','Ï','ï','İ');
    $western_chars['u'] = array('ù','Ù','ú','Ú','û','Û','Ü','ü');
    $western_chars['e'] = array('è','È','é','É','ê','Ê','Ë','ë');
    $western_chars['o'] = array('ò','Ò','ó','Ó','ô','Ô','õ','Õ','Ö' ,'ö','œ','Œ','ø','Ø');
    $western_chars['y'] = array('ý','Ý','Ÿ','ÿ');
    $western_chars['n'] = array('ñ','Ñ');
    $western_chars['d'] = array('ð','Ð');
    $western_chars['c'] = array('ç','Ç');

    $western_chars['s'] = array('ş','Ş');
    $western_chars['g'] = array('ğ','Ğ');

    ?>

    It's not working. http://dizin.acenteonline.com
    Dody question and how do to make in Polish systenie this coding utf -8?
    It how to adapt coding Polish signs in western_char.php
    Large letters
    A Ä„
    C Ć
    E Ę
    L Ł
    N Ĺƒ
    O Ă“
    S Ĺš
    Z Ĺą Ĺ»

    Small letters
    a Ä…
    c ć
    z Ĺş ĹĽ
    e Ä™
    l Ĺ‚
    n Ĺ„
    o Ăł
    Graphic appearance: http://www.krynica.malopolska.pl/charset.jpg

  13. #13
    Tomasz is offline Registered User
    Join Date
    Apr 2008
    Posts
    8

    Default

    Quote Originally Posted by Bobi View Post
    Dody question and how do to make in Polish systenie this coding utf -8?
    It how to adapt coding Polish signs in western_char.php
    Large letters
    A Ä„
    C Ä*
    E Ę
    L Ł
    N Ĺƒ
    O Ă“
    S Ĺš
    Z Ĺą Ĺ»

    Small letters
    a Ä…
    c ć
    z Ĺş ĹĽ
    e Ä™
    l Ĺ‚
    n Ĺ„
    o Ăł
    Graphic appearance: http://www.krynica.malopolska.pl/charset.jpg

    i'm polish user indexU. in my software link looks like this:
    %e4%98%e3%93%e4%84%e5%9a%e5%81%e5%bb%e5%b9%e4%86%e 5%83_1.html

    help me please

  14. #14
    Bruceper is offline Active Member
    Join Date
    Jun 2002
    Location
    Winnipeg Canada
    Posts
    4,913

    Default

    Users should really start their own threads if their issue is not identical to the one this thread is about.

    This thread is about the Turkish language

  15. #15
    Bobi is offline Registered User
    Join Date
    Dec 2006
    Posts
    103

    Thumbs up Users should really start

    Quote Originally Posted by Bruceper View Post
    Users should really start their own threads if their issue is not identical to the one this thread is about.

    This thread is about the Turkish language
    Bruceper
    If you can this very I ask about transfer in proper place
    Your support disappoints I will admit.And turn "30 Day Money Back Guarantee!"It seems to be absolutely already without covering I wrote to Dody And nothing,respect nothing Lords customers absolutely which they paid PLEASE

Page 1 of 2 12 LastLast

Similar Threads

  1. Turkish language character problem
    By secero in forum v5.x
    Replies: 0
    Last Post: 02-16-2008, 03:03 PM
  2. RSS character problem
    By TouchIt in forum v5.x
    Replies: 1
    Last Post: 11-03-2007, 01:02 PM
  3. Character Problem
    By uslanmaz in forum Pre-Sales Questions
    Replies: 9
    Last Post: 07-08-2007, 05:01 PM
  4. Replies: 0
    Last Post: 10-11-2006, 07:42 AM
  5. Special Character problem
    By chm3 in forum v5.x
    Replies: 3
    Last Post: 03-13-2006, 04:17 AM

Posting Permissions

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