Problem UTF-8

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Problem UTF-8

rperello
I'm spanish developer trying to localize my application to spanish language.
I changed some labels in the view.xhtml (xforms-control) and some of them have accents or native letters (ñ).
When i start the application i gather this error "Invalid byte 2 of 4-byte UTF-8 sequence."
I know the problem is character enconding. Mine enconding must be iso-8895-1, but i tried to put a xhtml:meta data in the commented xhtml ( in the xhtml:head section ) and doesn´t solve the problem.

I think the same problem occurs when i try to fill forms with the commented characters.

Where should i put the character enconding?

Thanks.



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Problem UTF-8

Martin Mohnhaupt
Hello,

As I develop in french, I had the same kind of problems.
To resolve them, I added an xml header into my files, like this:

<?xml version="1.0" encoding="iso-8859-1"?>
<html xmlns:xhtml="http://www.w3.org/1999/xhtml"
      xmlns:xforms="http://www.w3.org/2002/xforms"
      xmlns:xxforms="http://orbeon.org/oxf/xml/xforms"
      xmlns:ev="http://www.w3.org/2001/xml-events"
      xmlns:xi="http://www.w3.org/2001/XInclude"
      xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <title>Portail - Mesure de l'indépendance Fonctionnelle</title>
        <link rel="stylesheet" href="/mmpz/mif/styles.css" type="text/css"/>
        <xforms:model>
            <!-- Use the user info from the database -->
            <xforms:instance id="user-info">
                    <xi:include href="input:instance"/>
            </xforms:instance>
   .....

I hope this helps.

Kind regards,

-Martin


[hidden email] wrote:
I'm spanish developer trying to localize my application to spanish language.
I changed some labels in the view.xhtml (xforms-control) and some of them have accents or native letters (ñ).
When i start the application i gather this error "Invalid byte 2 of 4-byte UTF-8 sequence."
I know the problem is character enconding. Mine enconding must be iso-8895-1, but i tried to put a xhtml:meta data in the commented xhtml ( in the xhtml:head section ) and doesn´t solve the problem.

I think the same problem occurs when i try to fill forms with the commented characters.

Where should i put the character enconding?

Thanks. 

  

-- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: [hidden email] For general help: [hidden email] ObjectWeb mailing lists service home page: http://www.objectweb.org/wws

-- 
Martin Mohnhaupt
Nice Data Systems
Rue de Lyon 42 - CH 1203 GENEVE
Tél: +41 (0) 22 344 11 39
Mob: +41 (0) 78 636 00 75
Email: [hidden email]
Web: http://www.nicedata.com
Skype: martin.mohnhaupt
Action Carbone: http://www.actioncarbone.org


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Problem UTF-8

Erik Bruchez
Administrator
In reply to this post by rperello
[hidden email] wrote:
 > I'm spanish developer trying to localize my application to spanish
language.
 > I changed some labels in the view.xhtml (xforms-control) and some of
 > them have accents or native letters (ñ).
 > When i start the application i gather this error "Invalid byte 2 of
 > 4-byte UTF-8 sequence."
 > I know the problem is character enconding. Mine enconding must be
 > iso-8895-1, but i tried to put a xhtml:meta data in the commented
 > xhtml ( in the xhtml:head section ) and doesn´t solve the problem.
 > I think the same problem occurs when i try to fill forms with the
 > commented characters.
 > Where should i put the character enconding?

In your XML document's XML declaration, e.g.:

   <?xml version="1.0" encoding="ISO-8895-1"?>

Then you have to make sure your editor is actually using that
encoding.

(xhtml:meta won't do anything for you, as you have noticed. This is a
really dirty mechanism to set character encodings in HTML pages, and
XML has since solved this problem much more nicely :-)

You could also use a better encoding, like UTF-8, which is the default
if you don't specify an encoding in your XML declaration. You can also
configure it explicitly:

   <?xml version="1.0" encoding="UTF-8"?>

But you must then make sure that your editor is using UTF-8 as an
encoding, otherwise you will get conflicts such as the one you
describe. Using UTF-8 allows you to enter not only spanish characters,
but pretty much any character in existence.

-Erik

--
Orbeon Forms - Web Forms for the Enterprise Done the Right Way
http://www.orbeon.com/




--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws