pico_phone 0.6.4 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 229ea2d2854ff1815ecbc1c47252a8ea4c9a5f3aac0eefbc0549396d3d1ba8ce
4
- data.tar.gz: '0238aa3b95d4d6273c7120874e7087b411cc70fb14123ada5cab2e5a5bc69690'
3
+ metadata.gz: '0281a30979814bbbd46a0e38a86a16720b60405ecffa83f49ccc58c0f28b6fb1'
4
+ data.tar.gz: e00bd413fc3632b79b698e2ba85c3681281f38686de2b1eed361e1d3f1ef3d42
5
5
  SHA512:
6
- metadata.gz: eb80e6aa16a10f23c4adb6d4e98cbccccbe9c30243d87b6932cb1334fd832218e8454597d44f750131413efe768c4d9185ebfdd8eafe0f3bc155bc8b26589593
7
- data.tar.gz: ac9584bfdc5db60c89316d9cdfcfcd4b519965fe307a2f4cb8ae1c9d0969ddbbd50e721cedebe2178b3647afbf565d90b41de9935fb9816838085feee8151564
6
+ metadata.gz: 329152e9539675630b9c5658c9dbe81b58d0b60bb61aab9e42ac5dc40aba3a541f36f63085183a37f2de13d2d5e1f64b5b8967cf1890b51c11134a54b5ce17d2
7
+ data.tar.gz: f5f800e40abb31fa33d258af1c6924ca4c2cbac7e6c01b39f82d840eb6bc2a8bd5e9d7d4d8b9ca5850b263544424e28eaf3cb69aca05de8da1f1d99f1859c0a0
@@ -235,8 +235,9 @@ Copyright © 2016-2025 Unicode, Inc.
235
235
  License: Unicode License v3
236
236
  ================================================================================
237
237
 
238
- Statically embedded on macOS builds; dynamically linked at runtime on
239
- Linux (see ext/pico_phone/extconf.rb and build_deps.sh). ICU bundles
238
+ Statically embedded on macOS and musl Linux (e.g. Alpine) builds;
239
+ dynamically linked at runtime on glibc Linux (see
240
+ ext/pico_phone/extconf.rb and build_deps.sh). ICU bundles
240
241
  additional third-party notices covering optional components (word-break
241
242
  dictionaries for CJK/Lao/Burmese text segmentation, build tooling) that
242
243
  pico_phone does not use; the primary license covering the ICU library and
@@ -50,8 +50,15 @@ if NATIVE_BUILD
50
50
  %w[libicui18n libicuuc libicudata].each do |lib|
51
51
  static_libs << "#{icu_prefix}/lib/#{lib}.a"
52
52
  end
53
+ elsif RUBY_PLATFORM.include?("musl")
54
+ # musl (e.g. Alpine): unlike glibc there's no de facto stable system ICU
55
+ # package/ABI to assume is present at runtime, so build_deps.sh compiles a
56
+ # static ICU into VENDOR_INSTALL alongside abseil/protobuf/libphonenumber.
57
+ # Whole-archive it below along with those, rather than -l-linking dynamically.
58
+ static_libs += %w[libicui18n libicuuc libicudata].map { |lib| "#{VENDOR_INSTALL}/lib/#{lib}.a" }
59
+ $LOCAL_LIBS << " -lpthread -ldl"
53
60
  else
54
- # Linux: libphonenumber was built with USE_BOOST=OFF so no Boost needed.
61
+ # glibc Linux: libphonenumber was built with USE_BOOST=OFF so no Boost needed.
55
62
  # Ubuntu's libicu-dev static archives are not compiled with -fPIC and cannot
56
63
  # be linked into a shared object. Link ICU dynamically instead — libicu74 is
57
64
  # part of the Ubuntu 24.04 base system and is present in the target environment.
@@ -334,7 +334,12 @@ VALUE parsed_number_geo_name(int argc, VALUE *argv, VALUE self) {
334
334
  Locale locale(language_code.c_str());
335
335
  std::string description = GetGeocoder().GetDescriptionForNumber(*phone_number, locale);
336
336
 
337
- return rb_str_new(description.c_str(), description.size());
337
+ // Descriptions come from libphonenumber's per-language data files and can contain
338
+ // non-ASCII text (e.g. Japanese, accented Latin script) -- rb_str_new tags the
339
+ // result ASCII-8BIT, which silently breaks == against a UTF-8 literal for any
340
+ // non-ASCII content (7-bit-ASCII content is unaffected, since ASCII-8BIT and
341
+ // UTF-8 are equality-compatible there, which is why this went unnoticed).
342
+ return rb_utf8_str_new(description.c_str(), description.size());
338
343
  }
339
344
 
340
345
  // PhoneNumberCarrierMapper mirrors PhoneNumberOfflineGeocoder's lazy
@@ -357,7 +362,8 @@ VALUE parsed_number_carrier_name(int argc, VALUE *argv, VALUE self) {
357
362
 
358
363
  std::string name = GetCarrierMapper().GetNameForNumber(*phone_number, language_code);
359
364
 
360
- return rb_str_new(name.c_str(), name.size());
365
+ // See the matching comment in parsed_number_geo_name above -- same issue, same fix.
366
+ return rb_utf8_str_new(name.c_str(), name.size());
361
367
  }
362
368
 
363
369
  // PhoneNumberTimeZonesMapper eagerly loads its single flat prefix table
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PicoPhone
4
- VERSION = "0.6.4"
4
+ VERSION = "0.7.0"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pico_phone
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.4
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gabi Jack
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2026-08-14 00:00:00.000000000 Z
11
+ date: 2026-08-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rice