Dealing with accented characters

Discussion in 'Perl Misc' started by Mark Drummond, Jun 8, 2006.

  1. I don't do a lot of perl, but what I do usually always involves working
    with data in LDAP directories. I have a script now that I run every
    Monday to produce a CSV file containing a dump of some key user data
    from my directory. I pass that CSV on to some other people and they pull
    it in to Excel for viewing.

    We recently started allowing accented characters in the directory and
    I've noticed that the resulting CSV file ends up with some garbage in
    the fields where accepted chars are being used. I'm trying to figure out
    what I need to do to handle the accented characters properly.

    My script runs from my WinXP laptop, using ActivePerl 5.8.x with the
    latest perl-ldap module, connecting to a Sun directory server running on
    a Solaris/SPARC box. It simply retrieves the attributes of interest for
    all users in one branch of my DIT and outputs those attributes in CSV
    format to a file on my laptop. I then email that file to the people who
    need it.

    Any help is greatly appreciated!

    Mark
     
    Mark Drummond, Jun 8, 2006
    #1
    1. Advertising

  2. Mark Drummond

    Ben Morrow Guest

    Quoth Mark Drummond <>:
    > I don't do a lot of perl, but what I do usually always involves working
    > with data in LDAP directories. I have a script now that I run every
    > Monday to produce a CSV file containing a dump of some key user data
    > from my directory. I pass that CSV on to some other people and they pull
    > it in to Excel for viewing.
    >
    > We recently started allowing accented characters in the directory and
    > I've noticed that the resulting CSV file ends up with some garbage in
    > the fields where accepted chars are being used. I'm trying to figure out
    > what I need to do to handle the accented characters properly.
    >
    > My script runs from my WinXP laptop, using ActivePerl 5.8.x with the
    > latest perl-ldap module, connecting to a Sun directory server running on
    > a Solaris/SPARC box. It simply retrieves the attributes of interest for
    > all users in one branch of my DIT and outputs those attributes in CSV
    > format to a file on my laptop. I then email that file to the people who
    > need it.


    That's all good, but we can't help without

    1. A minimal script that reproduces the problem
    2. An example of input that fails
    3. What output that input should produce
    4. What output it, in fact, does produce

    I know nothing about how LDAP handles i18n, but, at a guess, your
    accented characters are going into the CSV as UTF8 and Excel is reading
    them as Windows-1251 (or whatever). The way forward is probably to write
    your CSV file in UTF16, which Windows seems to like. Without knowing how
    you write it, I can't tell you how to do that.

    Ben

    --
    All persons, living or dead, are entirely coincidental.
    Kurt Vonnegut
     
    Ben Morrow, Jun 8, 2006
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mickey Segal

    Text search with accented characters

    Mickey Segal, Dec 15, 2005, in forum: Java
    Replies:
    3
    Views:
    787
    Roedy Green
    Dec 16, 2005
  2. Davide Benini

    accented characters

    Davide Benini, Jun 1, 2005, in forum: XML
    Replies:
    4
    Views:
    814
    David Carlisle
    Jun 1, 2005
  3. Mark Drummond

    Dealing with accented characters

    Mark Drummond, May 31, 2006, in forum: Perl
    Replies:
    0
    Views:
    2,923
    Mark Drummond
    May 31, 2006
  4. Fuzzyman

    Problems With Accented Characters

    Fuzzyman, Feb 22, 2004, in forum: Python
    Replies:
    1
    Views:
    403
    Fuzzyman
    Feb 23, 2004
  5. Stephen Boulet
    Replies:
    3
    Views:
    404
    Terry Reedy
    Jul 16, 2004
Loading...

Share This Page