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

  • Home
  • SEARCH
  • 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 9102955
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T01:30:38+00:00 2026-06-17T01:30:38+00:00

My input has accent characterslike Í,Â,Ç Á, using xslt version 1.0 I need to

  • 0

My input has accent characterslike Í,Â,Ç Á, using xslt version 1.0 I need to render those characters without any change.

For example :
input Í ÇÂME HOME
output Í ÇÂME HOME
I dont want to encode/change those accent characters but
I am getting output like � ÇÂME HOME

What I have observed is:
Í is converting to Ã?
Ç to Ç
 to Â

If you observe all these characters are converting to capital a, tilde with additional chars(, ? ‡ )

Can anyone Please help me
My style sheet looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes" />
    <xsl:template match="/">

        <xsl:element name="root">
                      <xsl:value-of select="/../inputpath/msg"/>
                <\xsl:element>
</xsl:stylesheet>

Code used to transform xml

public static String transformByXslt(final String input, final String styleSheet,
            final Map<String, String> parameterMap, final ProductMetadata productMetadata,
            final ProductInstance productInstance, final Map<String, Object> daoMap) throws TransformerException,
            UnsupportedEncodingException, ValidationException, NoNeedToRenderException {

        final ByteArrayOutputStream out = new ByteArrayOutputStream();
        final TransformerFactory factory = TransformerFactory.newInstance();

        InputStream inputStream = null;

        inputStream = new ByteArrayInputStream(input.getBytes("UTF-8"));

        Transformer transformer = factory.newTransformer(new StreamSource(new ByteArrayInputStream(styleSheet
                .getBytes())));

        setParamsForXslt(transformer, parameterMap, productMetadata, productInstance, daoMap);
        transformer.setErrorListener(new PbErrorListener());
        try {
            transformer.transform(new StreamSource(inputStream), new StreamResult(out));
        } catch (TransformerException e) {
            if (ExceptionUtils.getRootCause(e) != null
                    && ExceptionUtils.getRootCause(e).getClass().equals(ValidationException.class)) {
                throw new ValidationException(e);
            } else if (ExceptionUtils.getRootCause(e) != null
                    && ExceptionUtils.getRootCause(e).getClass().equals(NoNeedToRenderException.class)) {
                throw new NoNeedToRenderException(e);
            } else if (ExceptionUtils.getRootCause(e) != null
                    && ExceptionUtils.getRootCause(e).getClass().equals(BlankRenditionException.class)) {
                return "";
            } else {
                throw e;
            }
        }

        return out.toString("UTF-8");
    }
  • 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-06-17T01:30:40+00:00Added an answer on June 17, 2026 at 1:30 am

    Rupesh, you are treating UTF-8 encoded data as signle-byte coded data or encoding UTF-8 twice. (the

    out.toString("UTF-8") 
    

    ???)

    First step is to figure out, what encoding is your data in and what encoding are you supposed to produce. For instance if you use Notepad++, it has a menu “Encoding” where it shows you the current encoding of the file and allows you to change it, see the effect. Tell us what’s the story.

    You might be after the western european windows ecoding: windows-1252

    Check this as well: the encoding attribute of the XSL output element

    I could give you some sample in C# if you like, but you run Java…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How do I check if input has been entered? For example (python2) x =
I'm trying to check if a form input has any value (doesn't matter what
I have a streaming input which has repeated values. I can use any data
Problem when I enter any input which has underscore (_) data will store to
Resharper has suggested to change from interface IModelMapper<TFrom, TTo> { TTo Map(TFrom input); }
So far I've been using ^[a-zA-Z]+( [a-zA-z]+)*$ to make sure user input Has no
while(1){ //Command prompt char *command; printf(%s>,current_working_directory); scanf(%s,command);<--seg faults after input has been received. printf(\ncommand:%s\n,command);
I have a standard text input that has a blur event. The blur event
I want to write an application that takes an XML-schema as input and has
@Oded: Sorry to have been poor in my exposition... My input document has a

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.