[Closed] When saving JSP, an encoding warning is displayed

This topic contains 6 replies, has 2 voices, and was last updated by  hua_jacky 12 years, 2 months ago.

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #243388 Reply

    hua_jacky
    Member

    I use myeclipse 4.0.3GA with eclipse 3.1 in windows xp sp2.
    when saving a jsp file, a encoding conversion warning message displayed, The messages is :
    The encoding(ISO-8859-1)cannot convert some characters(such as the one in position 138).Press’OK’ to save anyway(and some characters will be converted to’?’ int the saved file), or press ‘Cancel” to return to the editor.

    and I found a solution at https://www.genuitec.com/forums/topic/when-jsp-file-saving-a-encoding-warning-displayed/#post-242824
    I have some many jsps in my project, and I want to move some common declarations to a jsp file named jspheader.jsp which looks like below:
    <%@ taglib prefix=”ww” uri=”webwork” %>
    <%@ page contentType=”text/html;charset=GBK”%>

    and for some jsps just need include it, but this will result in above warning. how do i fix it?
    and I also found a feature in windows->preferences->myeclipse->editor->jsp, which looks like to control encoding when creating jsp file, but not for saving jsp file, I recommend myeclipse may save jsp file according to this option. anyone can help me?

    #243402 Reply

    Brian Fernandes
    Moderator

    Hua,

    Open up the properties for the files in question (right click the file in package explorer & choose properties).
    You will notice a radio button group labelled “Text file encoding” – change that from Default to Other – the GBK encoding is not listed, but you can still type it into the combo.

    Does this work for you?
    Best,
    Brian.

    #243412 Reply

    hua_jacky
    Member

    @support-brian wrote:

    Hua,

    Open up the properties for the files in question (right click the file in package explorer & choose properties).
    You will notice a radio button group labelled “Text file encoding” – change that from Default to Other – the GBK encoding is not listed, but you can still type it into the combo.

    Does this work for you?
    Best,
    Brian.

    Hi, Brian, thanks for you reply.:-)
    but this property has been setted to GBK before getting this problem.

    #243415 Reply

    Brian Fernandes
    Moderator

    Hua,

    Just confirming, for a particular file you set the encoding in File > Properties to GBK but you still see a warning stating “The encoding(ISO-8859-1)cannot convert some characters(such as the one in position 138).Press’OK'” while saving?
    If you check the file > properties page again, does the GBK encoding specified there persist? Could you check your log file to see if there are any errors? Here is the how you can do that: Posting Guidelines

    Does this file have any encoding declarations at all or does it simply include another file which contains the encoding information?
    Is it possible for you to paste the files involved here (or at least the headers) also mail them to support@genuitec.com ATTN Brian so that I have a good example to work with if possible.

    Best,
    Brian.

    #243426 Reply

    Brian Fernandes
    Moderator

    Hua,

    I forgot to mention this – could you navigate to
    Window > Preferences > General > Content Types > Text > MyEclipse JSP Content Type and update the default encoding to GBK and see if that solves your issue?

    Best,
    Brian.

    #243428 Reply

    hua_jacky
    Member

    Brian:
    Thanks for your help, your solution of File > Properties is right, but eclipse does not suuport GBK, does support GB2312 which is a subset of GBK, but it’s enough.
    right now i just inputed the GBK, but it displayed a error message of not supported encoding, so i posted previous message.
    Window > Preferences > General > Content Types > Text > MyEclipse JSP Content Type , i had set it, but it did not work.
    and I recommend windows->preferences->myeclipse->editor->jsp’s encoding option should be a combo box, so i can input specific encoding like GB2312, but now there are only 2 chinese encodings available for choosing, they are GB18030 and BIG5:-)

    #243429 Reply

    hua_jacky
    Member

    anyway, thank you very much, Support-Brian:-)

Viewing 7 posts - 1 through 7 (of 7 total)
Reply To: [Closed] When saving JSP, an encoding warning is displayed