Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5955801
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T18:09:55+00:00 2026-05-22T18:09:55+00:00

’ That is the character, and I cannot find a way to detect, replace,

  • 0

’

That is the character, and I cannot find a way to detect, replace, or write it properly to an XML file. At first I was using string concatenation, then I wisened up to XML::Writer, but it still won’t work, the XML is still broken afterward.(Need it in UTF-8)

This is a test I wrote that still breaks:

    my $output = new IO::File(">$foundFilePath");
    my $writer = new XML::Writer(OUTPUT => $output);
    $writer->xmlDecl("UTF-8");
    $writer->startTag("xml");
    $writer->startTag("test");
    $writer->characters("’");
    $writer->endTag("test");
    $writer->endTag("xml");
    $writer->end();
    $output->close();

To be more specific, I am trying to get the data from this page: http://investing.businessweek.com/businessweek/research/stocks/private/snapshot.asp?privcapId=4439466

And Mr. William O’Keefe is messing everything up.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T18:09:56+00:00Added an answer on May 22, 2026 at 6:09 pm

    There are two things you need to do. If you want to write UTF-8 to a file, you need to say so:

    my $output = IO::File->new($foundFilePath, ">:utf8");
    

    And if you want to use literal UTF-8 strings in your source code, you need to say

    use utf8;
    

    at the beginning of your program. Otherwise, Perl assumes your source code is Latin-1.

    Here’s a complete example script:

    use utf8;
    use strict;
    use warnings;
    use IO::File;
    use XML::Writer;
    
    my $foundFilePath = 'test.xml';
    my $output = IO::File->new($foundFilePath, ">:utf8");
    my $writer = XML::Writer->new(OUTPUT => $output);
    $writer->xmlDecl("UTF-8");
    $writer->startTag("xml");
    $writer->startTag("test");
    $writer->characters("’");
    $writer->endTag("test");
    $writer->endTag("xml");
    $writer->end();
    $output->close();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

string.insert in c# doesn't overwrite the character that is in the startindex does it?
I have an image file that has all the character sprites that I will
I am using VB6 and the Win32 API to write data to a file,
I cannot find the error that is being generated at right.GetText(); near the bottom.
Put simple, I cannot find a way to easily display furigana in a JLabel.
I notice that the character/symbol '`' and '@' is not used as an operator
I'm looking for a character that is just like • but an open circle
I need to flip an image so that a character faces in the right
Need a function that takes a character as a parameter and returns true if
Is there any equivalent function that returns the character at position X in PHP?

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.