Results 1 to 7 of 7

Thread: Ajax.request - Umlaut problem

  1. #1

    Default Ajax.request - Umlaut problem

    Hello,


    we have now problem with the germany "umlaut" (,,), if we used

    Ext.Ajax.request({
    url: furl,
    success: displayResult
    });


    we become then one wrong code for all umlauts, so that no differences.
    pls pay attention, all right mit HTML (encoding...), only per AJAX didn't do right.


    can anyone suggest us?

    Thanks a lot!

  2. #2
    Sencha User Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,245

    Default

    I assume you are using UTF-8 to encode the text with umlauts?

    1. Does your server return the data with Content-type: <mimetype>; charset=UTF-8?
    2. Is the HTML page itself in UTF-8 (otherwise you still can't display umlauts)?

  3. #3
    Sencha User Animal's Avatar
    Join Date
    Mar 2007
    Location
    Bédoin/Nottingham
    Posts
    30,890

    Default

    Quote Originally Posted by Condor View Post
    I assume you are using UTF-8 to encode the text with umlauts?

    2. Is the HTML page itself in UTF-8 (otherwise you still can't display umlauts)?
    This is not the case.

    Once a page's bytes have been read off the wire, and decoded into Characters using whatever decoding was specified in the packet's Content-Type header, then it's all just Unicode.

    You cannot initially send umlauts (or any character with diacritical marks) in the initial page which uses ISO-8859-1

    But if, subsequently, you make an Ajax request, and that receives eg "strupvej 53", then it will display fine.

    What matters is that the "charset" specified in the Content-Type header actually matches the encoding that was used to create the byte stream.

  4. #4

    Default

    hi,


    in HTML already defined:

    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">


    where should still define?


    Thanks

  5. #5
    Sencha User Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,245

    Default

    You also need to specify the Content-type in the header of your server response.

  6. #6
    Sencha User parsbin's Avatar
    Join Date
    Feb 2011
    Location
    Iran, Alborz, Karaj
    Posts
    123

    Default

    i have same problem but just in IE.
    Ext,Ajax.Request has worked perfect but when the user uses IE, the unicode characters not send healthy.
    i`v uses charset in my html page.
    my code is:
    PHP Code:
                handler: function(){
                    if(
    fp.getForm().isValid()){
                        var 
    sb Ext.getCmp('form-statusbar');
                        
    fp.getEl().mask();    
                        
                        var 
    val_name Ext.getCmp('name').getValue();
                        var 
    val_description Ext.getCmp('description').getValue();

                        var 
    url 'add_user.php?create=user'
                        
    +'&name='+val_name
                        
    +'&description='+val_description;

                        
    Ext.Ajax.request({
                                
    url:url,
                                
    scriptTagtrue,
                                
    success: function(result,request){
                                
    sb.setStatus({
                                    
    text:status_chap,
                                    
    iconCls:icon_show,
                                    
    cleartrue
                                
    });
                                
    fp.getEl().unmask();

                                }
                                
                            }); 
                    }
                } 

  7. #7
    Sencha User parsbin's Avatar
    Join Date
    Feb 2011
    Location
    Iran, Alborz, Karaj
    Posts
    123

    Default

    solved!
    i`v use:

    PHP Code:
    var enc=encodeURIComponent||escape;


    var 
    val_name enc(Ext.getCmp('name').getValue());
    var 
    val_family enc(Ext.getCmp('family').getValue());
    .
    .


Posting Permissions

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