Skip to content

Commit c0d497d

Browse files
committed
Force Unicode return from geocoding function
1 parent 319c33e commit c0d497d

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

python/phonenumbers/geocoder.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
# See the License for the specific language governing permissions and
4545
# limitations under the License.
4646

47-
from .util import prnt, U_EMPTY_STRING
47+
from .util import prnt, unicod, U_EMPTY_STRING
4848
from .phonenumberutil import format_number, PhoneNumberFormat, is_valid_number
4949
from .phonenumberutil import region_code_for_number
5050

@@ -120,7 +120,7 @@ def area_description_for_number(numobj, lang, script=None, region=None):
120120
# mapping language info to location name.
121121
name = _find_lang(GEOCODE_DATA[prefix], lang, script, region)
122122
if name is not None:
123-
return name
123+
return unicod(name)
124124
else:
125125
return U_EMPTY_STRING
126126
return U_EMPTY_STRING
@@ -155,7 +155,7 @@ def region_display_name(region_code, lang, script=None, region=None):
155155
# name is held elsewhere, specifically in the [other_lang] entry
156156
other_lang = name[1:]
157157
name = LOCALE_DATA[region_code].get(other_lang, "")
158-
return name
158+
return unicod(name)
159159
return U_EMPTY_STRING
160160

161161

0 commit comments

Comments
 (0)