Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6926691
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T10:57:06+00:00 2026-05-27T10:57:06+00:00

I’m having some trouble editing a table using <p:rowEditor> I use encoding=’windows-1252′ to be

  • 0

I’m having some trouble editing a table using <p:rowEditor>

I use encoding='windows-1252' to be able to use Swedish characters (å, ä, ö). Creating an entity works fine but when I edit it in a <p:dataTable> using <p:cellEditor> it commits characters that are unexpected. (If i enter "åäö" and save the edit (using p:celleditor), the table in the database contains "åäö").

My xhtml page starts like this:

<?xml version='1.0' encoding='windows-1252' ?> 
<!DOCTYPE html>
<html...

I’ve tried using a Character Encoding Filter:

public class CharacterEncodingFilter implements Filter {

    private static String ENCODING = "windows-1252";

    @Override
    public void destroy() {
    }

    @Override
    public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
        request.setCharacterEncoding(ENCODING);
        response.setCharacterEncoding(ENCODING);
        chain.doFilter(request, response);
    }

    @Override
    public void init(FilterConfig config) throws ServletException {
    }
}

But to no avail. Any ideas why incell editing posts using a different character encoding?

Using:

  • NetBeans 7.0.1
  • Glassfish 3.1
  • Primefaces 3.0.M4
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T10:57:06+00:00Added an answer on May 27, 2026 at 10:57 am

    If i enter "åäö" and save the edit (using p:celleditor), the table in the database contains "åäö"

    That’s a typical CP1252 representation of UTF-8 encoded characters. In UTF-8, those characters are represented by the following bytes:

    • å (U+00E5) = 0xC3 0xA5
    • ä (U+00E4) = 0xC3 0xA4
    • ö (U+00F6) = 0xC3 0xB6

    If you lookup those six individual bytes in the CP1252 codepage layout, you’ll see that they represent exactly those characters åäö.

    JSF/Facelets defaults to UTF-8 character encoding when it comes to generating the HTML response and processing the POST requests. That XML encoding attribute really doesn’t change anything to that. It merely tells the XML parser which character encoding you’ve written/saved the file in so that it can parse it with the proper character encoding.

    Changing the character encoding of the HTML response and processing of POST requests is to be done by setting the encoding attribute of the view root tag <f:view>:

    <f:view encoding="CP1252">
    

    But, I strongly disrecommend this. This way you’re falling back from an universal character encoding which supports over a million characters to a proprietary character encoding which supports no more than 255 characters and is understood by Windows platforms only. Webpage visitors which use Mac/Linux or any other operating system will not be able to properly interpret the HTML response in that character encoding, nor will it be able to send the data back in that character encoding. Your web application will not be ready for successful world domination.

    You need to solve this problem differently. It’s apparently your database which needs to be changed to support UTF-8. How exactly to do this cannot be answered, because you didn’t tell anything about the DB make/version. But changing the DB’s/table’s character encoding should be a matter of some SQL commands. Or if you’re experimenting, just by truncating the DB and recreating it with the proper charset. Refer the DB-specific SQL manual for details.

    See also:

    • Unicode – How to get the characters right?
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
We're building an app, our first using Rails 3, and we're having to build
I'm having trouble keeping the paragraph square between the quote marks. In firefox the
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
For some reason, after submitting a string like this Jack’s Spindle from a text
I am trying to understand how to use SyndicationItem to display feed which is
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am reading a book about Javascript and jQuery and using one of the
I want use html5's new tag to play a wav file (currently only supported

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.