Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re^2: Detect wrong characters

by LexPl (Sexton)
on Dec 02, 2024 at 14:55 UTC ( [id://11162974]=note: print w/replies, xml ) Need Help??


in reply to Re: Detect wrong characters
in thread Detect wrong characters

If there are strings from a foreign language in my text, they could conflict with my encoding "ISO-8859-1". Let me give you 2 examples:

  • You have got a sentence which contains the Greek equivalent of the German term "Steuerbescheid": εκκαθαριστικό φορολογίας
  • Your text might contain a letter that looks like a small "o", but the author used the small Greek omicron "ο" which looks the same, but is technically different.

Unfortunately, I haven't yet any code to show to you, as I don't know how to do this.

Replies are listed 'Best First'.
Re^3: Detect wrong characters
by LanX (Saint) on Dec 02, 2024 at 18:09 UTC
    Probably someone entered text encoded in utf8 or another foreign encoding in the fields. If you can read them, it means your editor is configured to do so. Set it to Latin 1 to spot the difference.

    You have to identify which encoding was used and hope to code a heuristic to correct those. Like the special start bytes of Utf8 wide characters.

    You will end up needing to check and trust the heuristic, or manually correct everything.

    As far as I see does ISO Latin 1 not include Greek letters. Hence you have to translate them to HTML entities.

    (I suppose that's allowed in the document's definition)

    Cheers Rolf
    (addicted to the Perl Programming Language :)
    see Wikisyntax for the Monastery

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11162974]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (3)
As of 2025-02-15 13:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found