Zoe Saldana, left, as Uhura and John Cho as Sulu in “Star Trek Beyond.” (Kimberley French/Paramount Pictures via AP)

JOHN CHO was in the United Arab Emirates, seeking an Asian husband.

“Star Trek Beyond” was shooting in Dubai, and Cho’s character, Sulu, would come out as gay in the new movie. The filmmakers had decided on a simple, brief scene of family reunion in which we glimpse the warm, quiet embrace of the starship Enterprise helmsman, his co-parent and a child. The only snag? Trying to cast a spouse, as they looked about while overseas.

“I know that they were having some trouble finding the right actor,” says Cho, in his third turn as Sulu, “and I knew that had to do with finding an Asian actor in Dubai that was willing to be gay.” The ultimate decision: The film’s own co-writer, Doug Jung, was cast as Sulu’s husband.

The Sulu reveal might be a character milestone in the long arc of Star Trek, which celebrates its 50th birthday this year, but the scene is played with an understatement that feels in line with the franchise’s history of normalized inclusiveness.

When Gene Roddenberry created “Star Trek” in the mid-’60s, the show was among TV’s forerunners in reflecting diversity on the screen. And upon its 50th anniversary, in a political year marked by much divisiveness, Star Trek is still seeking to boldly go where relatively few aged franchises have gone before — even when such decisions meet with unexpected turbulence.

From the outset, “Star Trek’s” episodic morality plays managed to entertain while also commenting with critical optimism on those tumultuous times. Now, with “Beyond” — which opens Friday and debuts at San Diego’s Comic-Con on Wednesday evening — what do we see in Star Trek’s 23rd-century diversity that might illuminate events in 2016?

“In so many ways, the diversity issue is a question that was alive in 1966,” when “Star Trek” (a.k.a. “The Original Series”) debuted, Cho says. “We obviously talk about a lot of parallels [between each end of] those 50 years in the political climate. … We were talking about race in similar ways.”

The original series, Star Trek historian Mark A. Altman says, was “progressive” in that it included characters from different cultures, and eschewed national exceptionalism — a theme that still speaks to us.

“How do we make this relevant to the 50th anniversary?” Jung says was the question that he, director Justin Lin and co-writer Simon Pegg kept asking themselves. “That means being relevant to the socioeconomic climate of society.” And in “Star Trek Beyond,” some of the new, gritty and self-determined characters act out of feeling abandoned or minimized by a system.

When the show was created, Altman notes, NBC was very much pushing for diversity in its casting, in such shows as the Bill Cosby-starring “I Spy,” which started in 1965 — in part as a push from the network’s Stanley Robertson, who was one of the few African American television executives. “Diversity was important to him and he was dealing with racism,” says Altman. “In a way, he was the Sidney Poitier of television.”

The series included Nichelle Nichols, who played the communications officer Lt. Uhura, a rare position of authority at the time for a black, female TV character. Uhura never got to assume the captain’s chair — at least not until “Star Trek: The Animated Series,” Altman notes — but he says she was sixth in the line of succession on the Enterprise.

And now, Zoe Saldana, who returns as Uhura in “Star Trek Beyond,” says that in inheriting the role, she feels a responsibility of upholding Nichols’s torch for representing positive social change.

“It’s a flame for women,” Saldana says. “My mission is not color. … My mission is for women to be equal, for women to be relevant, and to hear from more women who are making decisions.”

In addition, the character of Sulu, played by George Takei, was a big step forward. “It’s hard to appreciate the impact of a Japanese helmsman only two decades after World War II — there was still a lot of resentment toward the Japanese,” says Altman, the co-author of the new Star Trek oral-history book “The Fifty-Year Mission (The First 25 Years)” (Volume 2, covering the next 25 years, arrives next month).

Cho was conscious of racial representation, as well — like when he asked the filmmakers to cast his “Beyond” spouse.

“The reason I wanted him to be Asian is that it was a tribute,” the actor says. “My Asian friends who are gay say they have felt it was extra-hard for them because of the culture, so I wanted to represent a future in which it was totally normal.”

Takei surprised many fans this month when he expressed dissatisfaction with the decision to out Sulu. Takei, who came out himself in 2005, eventually clarified his remarks to say that he welcomed the addition of a gay character, but that having Sulu be gay wasn’t part of Roddenberry’s original vision.

“I respect where he’s coming from, and I admire him so much as an actor and as a political activist,” Cho says of Takei’s reaction. “It’s a hard thing to argue because Roddenberry isn’t here to speak out. We have to infer what he would have approved and disapproved of.

“I choose to believe he would have been tickled by it,” Cho continues. “There is inspiration in the line he always said: ‘Infinite diversity in infinite combinations’ [the basis of the series’s Vulcan philosophy]. Were he alive, he would have addressed this lack of gay representation in space way before we did.”

Screenwriter Jung says of adding an LGBT character, “It seemed a logical extension of how the world really is.” He adds, of “Star Trek’s” inclusive utopia, “This is just everyday life there.”