SQL-Ledger Homepage

SQL-Ledger User Forum

Forum index page

Log in | Register

Back to the forum
Board view  Mix view

Still problems with german special characters (General)

posted by Leho Kraav(R), 18.07.2017, 22:16


Could SL::Form::escape() and unescape() be involved here? These look like
incredibly risky replacement operations for unicode.

Wow, it IS these custom escaping functions :(

With a full modern Unicode stack setup, we need to manually encode/decode after escaping. This is how form input gets saved into the database in normal UTF-8 form.

```
package Form;
use Encode;
use utf8;

sub escape {
...

$str = encode('UTF-8', $str);
$str =~ s/([^a-zA-Z0-9_.-])/sprintf("%%%02x", ord($1))/ge;

...

}


sub unescape {
...

$str =~ s/%([0-9a-fA-Z]{2})/pack("c",hex($1))/eg;
$str = decode('UTF-8', $str);

...
}
```

Dieter, have you been aware of this Unicode solution strategy?

Would be super interesting to get hartundweich's testing this.

 

Complete thread:

Back to the forum
Board view  Mix view
991 Postings in 327 Threads, 327 registered users, 56 users online (0 registered, 56 guests)
SQL-Ledger User Forum | Admin contact
RSS-Feed
powered by my little forum