Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Polish characters causing problems

  • 30-08-2007 1:29pm
    #1
    Registered Users, Registered Users 2 Posts: 21,263 ✭✭✭✭


    Hi folks,

    Our company website has a large Polish section, including some ordering forms. The output of these forms is exported into CSV and imported into various systems on various platforms.

    A good few of the names have Polish characters in them - depending on the browser, back-end system these are translated into a range of characters - some of them control characters. I only have control over the website code, and changing any of the other systems will be a much larger piece of work.

    Although not ideal, it looks like client side JavaScript is the most reliable way to check for the characters, and then replace them with the closest alternatives. I could also change them to their HTML entity equivalent, but this will cause problems when the output is exported again. I know that you can't rely on client side JavaScript, but by the time the text has reached the webserver, it may already have been translated to something entirely different anyway.

    Putting the following meta-tag doesn't work:
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-2"/>
    

    Has anyone else run into a similar problem - if so, how did you get around it?

    Eoin


Comments

  • Registered Users, Registered Users 2 Posts: 3,594 ✭✭✭forbairt


    What character set are they exported as ?

    What type of database are you reading them into for the website ?


  • Closed Accounts Posts: 198 ✭✭sh_o


    I had a similar issue dealing with Japanese characters on a form and then emailing them onto multiple destinations. I tried lots of different ways and character encoding and in the end gave up and ended up doing the folowing ( I hadn't any more time to spend trying other things out!) -

    I used UTF-8 as the encoding on the web page and then when the web form was posted, the characters would be automatically translated into html entites.
    On the server side (processing the form), I then used some jsp to call HTMLEntites on the server side to convert the code back to the actual characters that should be there which I then passed onto a bean to email the correct characters.

    Not ideal I know but it worked!


  • Registered Users, Registered Users 2 Posts: 21,263 ✭✭✭✭Eoin


    Thanks for that - I had a bit of problems with the encoding, again it could be to do with the crappy platform we're using. I tried the UTF-8, but it did funny things with some of the characters here.

    I ended up using the CMS to create a table of translations which the content team can edit. This is printed out into a client side JavaScript function which escapes the textbox and textarea values into UNICODE, and then does a search and replace.

    So, if someone enters a Polish character like ą (may not appear properly here), it is converted on the client into %u0105. The function can then replace this with whatever Latin character is appropriate.


  • Registered Users, Registered Users 2 Posts: 1,127 ✭✭✭smcelhinney


    When I first saw the subject I thought it was something to do with some undesirable eastern Europeans hanging around by your local Dunnes Stores.. imagine my dismay.. :rolleyes:

    What about using XML and ENTITY declarations, and transforming on the fly? This is how I would do it, but I wouldnt swear by it..

    Google XML ENTITY non-standard characters, that will give you a starting point.


  • Registered Users, Registered Users 2 Posts: 21,263 ✭✭✭✭Eoin


    When I first saw the subject I thought it was something to do with some undesirable eastern Europeans hanging around by your local Dunnes Stores.. imagine my dismay.. :rolleyes:

    What about using XML and ENTITY declarations, and transforming on the fly? This is how I would do it, but I wouldnt swear by it..

    Google XML ENTITY non-standard characters, that will give you a starting point.

    I could probably have worded it better actually!

    Thanks for the suggestion, I'll check that out now.


  • Advertisement
Advertisement