1. #1
    Ext User
    Join Date
    Mar 2007
    Posts
    17
    Vote Rating
    0
    HorsMark is on a distinguished road

      0  

    Default Setting updatemanager to use ISO-8859-1

    Setting updatemanager to use ISO-8859-1


    Hi all

    I have this problem with ø æ and å (æøå) danish characters... but when i post stuff things go wrong...

    I get this å instead of &aring

    What to do ?

    regards
    Jesper HorsMark

  2. #2
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,508
    Vote Rating
    56
    Animal has a spectacular aura about Animal has a spectacular aura about Animal has a spectacular aura about

      0  

    Default


    Wouldn't it be the server side that you want to be looking at?

    You should ensure that it encodes the characters properly into a stream of bytes using the encoding scheme that you expect, and then declares that encoding in the Content-Type header:

    http://www.w3.org/Protocols/rfc2616/....html#sec14.17

  3. #3
    Ext User
    Join Date
    Mar 2007
    Posts
    17
    Vote Rating
    0
    HorsMark is on a distinguished road

      0  

    Default


    This is what i set serverside on both input page and the handler page

    header('Content-Type: text/html; charset=ISO-8859-1');

    It works well in other cases only submitting forms crashes the charset - i expect it´s the YUI connect missing the right encoding ?

    // What i do
    YAHOO.util.Connect.setForm(formObject);
    var cObj = YAHOO.util.Connect.asyncRequest('POST', oForm.action, callback);

  4. #4
    Sencha User
    Join Date
    Mar 2007
    Posts
    7,854
    Vote Rating
    4
    tryanDLS is on a distinguished road

      0  

    Default


    Did you try calling initHeader on the Connect object to set the encoding type? If that doesn't work - try posting a ? in the YUI forum.

  5. #5
    Ext User
    Join Date
    Mar 2007
    Posts
    17
    Vote Rating
    0
    HorsMark is on a distinguished road

      0  

    Default


    @Tim >> about the YUI connect:

    <snip>
    There's no need to set the "Content-type" header for POST requests. The Connection Manager handles this for you behind the scenes.
    </snip>

    ?

  6. #6
    Ext User
    Join Date
    Mar 2007
    Posts
    17
    Vote Rating
    0
    HorsMark is on a distinguished road

      0  

    Default


    tried this... still the same result

    YAHOO.util.Connect.setForm(formObject);
    YAHOO.util.Connect.initHeader( "Content-Type", "application/x-www-form-urlencoded; charset=ISO-8859")
    var cObj = YAHOO.util.Connect.asyncRequest('POST', oForm.action, callback);

  7. #7
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,508
    Vote Rating
    56
    Animal has a spectacular aura about Animal has a spectacular aura about Animal has a spectacular aura about

      0  

    Default


    OK, I get what you meant. It's the browser's encoding that you want to be ISO-8859-1.

    From your first post, it looks like it's using UTF-8.

    I don't imagine that setting headers in the XMLHttpRequest will change the way the string collected by setForm() is encoded into bytes. Perhaps I'm wrong, but this is probably a browser setting.

    Have you tried changing your server to decode from UTF-8? Are you using Java at the back end?

  8. #8
    Ext User
    Join Date
    Mar 2007
    Posts
    17
    Vote Rating
    0
    HorsMark is on a distinguished road

      0  

    Default


    @animal

    Thx for the reply ...

    Well i´m on a linux apache server running php ... posting normally widthout YUI works just fine so it has to be the YUI formdatacollecter which do not encode properbly...

    ...and I cannot imagine that i´m the first one needing the correct ISO encoding :-) ~ but i do have searched the entire forum and cannot find anyone width this problem ...

  9. #9
    Ext User
    Join Date
    Mar 2007
    Posts
    17
    Vote Rating
    0
    HorsMark is on a distinguished road

      0  

    Default


    @animal

    ... and yes if i utf8_decode the POST data everything plays well ~ but in my opinion it´s a hack - this decoding had to be set on the YUI connect...

    don´t you think so ?

  10. #10
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,508
    Vote Rating
    56
    Animal has a spectacular aura about Animal has a spectacular aura about Animal has a spectacular aura about

      0  

    Default


    Is that Content-Type header that you set actually getting sent?

    Looking into YUI's code, it can get overriden, here's the code in asyncRequest:

    Code:
    			if(this._isFormSubmit || (postData && this._use_default_post_header)){
    				this.initHeader('Content-Type', this._default_post_header);
    				if(this._isFormSubmit){
    					this.resetFormState();
    				}
    			}
    Check with Firebug's "Net" tab, and if it's getting overriden by YUI try adding

    Code:
    YAHOO.util.Connect.setDefaultPostHeader(false)
    This clears the _use_default_post_header flag which should stop it usinging its own Content-Type header.

Similar Threads

  1. Replies: 4
    Last Post: 29 Jun 2007, 5:07 AM
  2. setting ids on grid rows...
    By sean in forum Ext 1.x: Help & Discussion
    Replies: 3
    Last Post: 29 Mar 2007, 7:14 AM
  3. Event constructor not setting name?
    By punkrider in forum Ext 2.x: Help & Discussion
    Replies: 2
    Last Post: 19 Feb 2007, 11:22 AM
  4. dynamically setting ContentPanel for a layout
    By rahulmca1@gmail.com in forum Ext 1.x: Help & Discussion
    Replies: 1
    Last Post: 8 Feb 2007, 4:42 AM
  5. YAHOO.ext.UpdateManager setting Content-Type for ISO-8859
    By young_matthewd in forum Ext 1.x: Help & Discussion
    Replies: 3
    Last Post: 14 Nov 2006, 11:32 AM

Thread Participants: 7