Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: restore unicode data from database?

by graff (Chancellor)
on Dec 01, 2002 at 23:12 UTC ( #216822=note: print w/replies, xml ) Need Help??


in reply to restore unicode data from database?

The man page for the "Encode" module in Perl 5.8.0 points out the following, under the heading "The UTF-8 flag", sub-heading "Messing with Perl's internals":
The following API uses parts of Perl's internals in the current implementation. As such, they are efficient but may change. ... _utf8_on(STRING) [INTERNAL] Turns on the UTF-8 flag in STRING. The data in STRING is not checked for being well-formed UTF-8. Do not use unless you know that the STRING is well-formed UTF-8. Returns the previous state of the UTF-8 flag (so please don't treat the return value as indicating success or failure), or "undef" if STRING is not a string.
I'm not saying that this is a good alternative to the work-around that you are already using. I have a hunch that anything else, that would actually treat the RDBM as a utf-8 source, would require mucking with the DBD or Tie:RDBM module internals, and would be problematic, since a database (and any interface to it) needs to be flexible about handling many types of non-ASCII data -- not just unicode characters.

Personally, I'd be content with the method you are already using.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://216822]
help
Chatterbox?
[Discipulus]: shemem i wrote it directly.. but when i tested it i got a lot of 'undefined value..'
[Corion]: Oh, poor Trump can't get a break. Even the Vatican only sends the second in command to greet him...
[shmem]: Discipulus: readdir has the same semantics as readline (a.k.a <>). Have another coffee ☕ ;-)
[Discipulus]: ah! just with my old system perl (5.8.8) was needed
[Corion]: Has anybody toyed around with Mastodon? There is a Perl module for it, but I'm not sure that it's a yak worth chasing
[Corion]: On the upside, maybe running that for my family would be interesting, or at least for myself
[Corion]: I'm not fond of using a server hosted by other people, even if they claim to be GNU ;)
[Discipulus]: gee a social network with the family.. is this a dread? ;=)

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (8)
As of 2017-05-26 07:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?