1. #1
    Sencha User
    Join Date
    Oct 2008
    Posts
    278
    Vote Rating
    0
    livinglegends is on a distinguished road

      0  

    Default TextField cannot disply Unicode character

    TextField cannot disply Unicode character


    Hi,

    In application, there is one utility, in which user can select file from Hard disk and after selecting file when user click on Submit button, it reads content of file and display data in text field.

    Problem:

    1. I have stored some data in notepad in Unicode format (At time of saving, selected Unicode in Encoding box)
    2. When user select that file and click on submit button it display data in textfield as show in attached image.

    So, How to display unicode data in textfield?

    Thanks
    LivingLegends

    [IMG]file:///C:/DOCUME%7E1/jshah/LOCALS%7E1/Temp/moz-screenshot.png[/IMG][IMG]file:///C:/DOCUME%7E1/jshah/LOCALS%7E1/Temp/moz-screenshot-1.png[/IMG]
    Attached Images

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

      0  

    Default


    The font you are using does not have the glyphs for the codepoints.

    Are you switching to a different font?

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

      0  

    Default


    But saving as "Unicode" does not have a meaning. Microsoft have done something weird there.

    You can save using an encoding, but Unicode is just a standard which defines glyphs for codepoints.

  4. #4
    Sencha User
    Join Date
    Oct 2008
    Posts
    278
    Vote Rating
    0
    livinglegends is on a distinguished road

      0  

    Default


    Quote Originally Posted by Animal View Post
    The font you are using does not have the glyphs for the codepoints.

    Are you switching to a different font?
    I have not set any font explicitly. it default font set by Extjs.

    I think it doesnt related to font.

    Because I have captured data sent by extjs on server and display it and it shows in different format.

    Let say, there are 4 words in my file (all are in new line), test hello solution legal.

    On server, it shows space between each character like "t e s t", "h e l l o" etc.

    It means it read data in different format

  5. #5
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,251
    Vote Rating
    73
    Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold

      0  

    Default


    Quote Originally Posted by livinglegends View Post
    I have not set any font explicitly. it default font set by Extjs.

    I think it doesnt related to font.

    Because I have captured data sent by extjs on server and display it and it shows in different format.

    Let say, there are 4 words in my file (all are in new line), test hello solution legal.

    On server, it shows space between each character like "t e s t", "h e l l o" etc.

    It means it read data in different format
    This looks like UTF-16 interpreted as UTF-8 or ISO-8859-1.

    Where is this data coming from? Did you specify the correct Content-type for this data?

  6. #6
    Sencha User
    Join Date
    Oct 2008
    Posts
    278
    Vote Rating
    0
    livinglegends is on a distinguished road

      0  

    Default


    Let me explain you the flow in short.

    1. User select file(in unicode format) from front end (extjs) and click on submit button.
    2. That fill will be sent to server side where I read content, generate String
    3. send string back to client
    4. At client displaying this string in text field where I couldn't read it


    I have changed my server side code to read content from file by encoding using UTF-16 and problem solved but now it crated problem to read non-unicode format file.

    So, what can be common solution? Which encoding format should I use to read any kind of file?

  7. #7
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,251
    Vote Rating
    73
    Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold

      0  

    Default


    Your server needs to detect the Content-type of the submitted file (search - this has probably already been written by somebody for your particular server-side language).

  8. #8
    Sencha User
    Join Date
    Oct 2008
    Posts
    278
    Vote Rating
    0
    livinglegends is on a distinguished road

      0  

    Default


    Quote Originally Posted by Condor View Post
    Your server needs to detect the Content-type of the submitted file (search - this has probably already been written by somebody for your particular server-side language).
    I have written code to get content-type of file but for both the type of file (unicode and non-unicode), I am getting same content-type "text/plain".

    I think I need encoding format or type for particular file. Do you have any idea how to get it?

    I am searching but didn't get any thing.

  9. #9
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,251
    Vote Rating
    73
    Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold Condor is a splendid one to behold

      0  

    Default


    No, it's the charset part of the Content-type that's needed here.

  10. #10
    Sencha User
    Join Date
    Oct 2008
    Posts
    278
    Vote Rating
    0
    livinglegends is on a distinguished road

      0  

    Default


    Quote Originally Posted by Condor View Post
    No, it's the charset part of the Content-type that's needed here.
    When I have applied code to read content type of selected file, it return me application/octet-stream content type. So it couldn't read the content and utility stop to work and throws exception java.io.UnsupportedEncodingException: application/octet-stream

Similar Threads

  1. TextField stripCharsRe Only Operating on a Single Character
    By bballiet in forum Ext 3.x: Help & Discussion
    Replies: 1
    Last Post: 12 Apr 2013, 10:32 AM
  2. Replies: 7
    Last Post: 3 Apr 2010, 4:36 AM
  3. Help: Unicode in textfield
    By christanto in forum Ext 3.x: Help & Discussion
    Replies: 1
    Last Post: 31 Aug 2009, 4:50 AM
  4. HTML character in textfield
    By moegal in forum Ext 2.x: Help & Discussion
    Replies: 6
    Last Post: 15 May 2009, 6:11 AM
  5. unicode strings in textfield
    By archmisha in forum Ext 2.x: Help & Discussion
    Replies: 13
    Last Post: 28 Feb 2009, 11:05 AM

Thread Participants: 2

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar