Charleston has topped lots of prestigious lists recently, winning accolades as a polite city popular with tourists and young entrepreneurs alike, but this week the city topped another list that has city officials steaming.

In a story about cities facing financial strains, The Wall Street Journal identified Charleston, in a chart that appeared online, as having zero cash on hand to pay its bills — giving Charleston the worst ranking on a list of the nation’s 250 largest cities.

A photograph of Charleston City Hall during the opening ceremony for Spoleto Festival USA served as a background for the chart. Ouch.

Charleston in fact has large cash reserves and top ratings from credit agencies, but online comments about Charleston’s apparently dire financial condition and links to the charts were quickly picked up on Twitter, Facebook and other social media, with a number of people comparing Charleston to bankrupt Detroit.

“I feel kind of like one of those kids bullied online,” said Charleston Chief Financial Officer Stephen Bedard. “This stuff gets out and it is ugly.”

Mayor Joe Riley said he was angry when he learned of the article, and is preparing “a strong response” to The Wall Street Journal, which he sharply criticized for publishing a piece that he said displayed “an amazing unfamiliarity with municipal finance.”

“It’s bad that such a venerable newspaper has such a sloppy process for reporting something that’s very important,” Riley said. “It would be like me writing an article about neurosurgery.”

A spokeswoman for The Wall Street Journal said the series about municipal finance was meant to encourage readers to explore data and ask questions.

“In fact, our blog post, ‘Warning Signs? How To Understand Your City’s Finances,’ offers advice on how readers can mine their city’s finances for more information and create larger discussions,” Colleen Schwartz said. “We’re pleased to learn that this is exactly what’s happening in Charleston.”

Bedard said people he knows around the country have been sending emails, saying they hope it’s not true that Charleston has no cash with which to pay its bills.

“A lesson I sure have learned here is that with the power of the Internet, it is very important to understand the nuances of what one is implying,” he said.

Joe Good, a candidate for Charleston City Council, posted a link to the disputed chart on his Facebook page and commented:

“We deserve better! As City Councilman, I will fight for fiscally responsibility, so we don’t have to ever worry about becoming the next Detroit.”

Bedard said Charleston has no trouble paying its bills.

“If the city were in the level of distress implied, it certainly would not have the highest credit ratings of any cities in South Carolina as given by both S&P and Moody’s,” he said.

In 2009, in the depths of the Great Recession, Standard & Poor’s Ratings Services upgraded Charleston’s credit rating for long-term debt to AAA — that’s sort of like an individual having a credit score above 800.

Charleston was the first city in South Carolina to get such a high rating, which the rating agency said was due to “the historical maintenance of a very strong financial position through positive and stable performance, and consistent tax base growth,” among other factors.

Schwartz said the Journal’s “Cities Under Strain” infographic was based on information from Merritt Research Services, which examined the 2012 financial reports from the 250 largest U.S. cities.

The disconnect between what the Journal reported and the financial reality in Charleston is rooted in a quirk of the city’s budget. It’s correct that the city’s annual financial report showed zero cash in the city’s general fund on Dec. 31, 2012, but it’s equally correct to say the city had more than $43 million on hand at the time.

Riley said that’s like considering how much money is in a person’s wallet while ignoring their bank accounts.

Here’s the wonky part: Unlike most cities and towns, Charleston’s budget runs on a calendar year rather than a fiscal year, which in most municipalities begins in July or October to synch up with state or federal budget years. That means that on Dec. 31, the last day of Charleston’s budget year, the city’s general fund is typically depleted, but there’s money elsewhere in the budget.

One reason for that is, property tax bills go out in the fall, but they aren’t due until early the next year. So every year Charleston’s budget includes revenues the city won’t actually get until after that year ends.

The key part is, the city has so much cash in reserve and in special-purpose funds — about $120 million at the end of 2012 looking at all the accounts, Bedard said — that it has no trouble paying bills while awaiting tax revenues.

Cities that truly have cash-flow problems commonly issue what are called tax-anticipation notes, which are the municipal equivalent of a payday loan, but with lower interest charges. Charleston used to do that, but hasn’t since 2002, and having enough cash on hand to avoid tax-anticipation notes has saved the city lots of money.

During the last five years that Charleston issues such notes, 1998-2002, the city paid more than $2.4 million in interest.

Bedard said the ironic thing is that cities in bad financial shape that issued tax-anticipation notes would look better in the wsj.com ranking of cash-on-hand than Charleston.

Reach David Slade at 937-5552.