GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Storage: Content-Range header is formatted with default locale · Issue #2972 · googleapis/java-storage

This repository was archived by the owner on Sep 25, 2026. It is now read-only.
This repository was archived by the owner on Sep 25, 2026. It is now read-only.

Storage: Content-Range header is formatted with default locale #2972

Copy link
Copy link
Closed
#2965
#2974
Closed
Storage: Content-Range header is formatted with default locale#2972
#2965
#2974
Copy link
Labels
api: storageIssues related to the googleapis/java-storage API.priority: p2Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Description

@nicktindall
nicktindall
opened on Mar 5, 2025
Issue body actions

Environment details

OS type and version: Mac OS X/15.3.1/aarch64
3. Java version: Oracle Corporation/OpenJDK 64-Bit Server VM/23/23+37-2369
4. version(s): 2.48.2

Steps to reproduce

  1. Run Java with locale that uses non-english number characters (e.g. ps)
  2. Execute a resumable upload

Any additional information below

The range header is generated formatting the numbers using the default locale. So for ps we get

bytes ۰-۹۲۱۷۳۷۵/۹۲۱۷۳۷۶ when it should be bytes 0-9217376/9217376

See examples of the issue

  • java-storage/google-cloud-storage/src/main/java/com/google/cloud/storage/HttpContentRange.java

    Line 94 in 68e1cf2

    return String.format("bytes %d-%d/*", spec.beginOffset(), spec.endOffsetInclusive());
  • java-storage/google-cloud-storage/src/main/java/com/google/cloud/storage/HttpContentRange.java

    Line 148 in 68e1cf2

    return String.format("bytes %d-%d/%d", spec.beginOffset(), spec.endOffsetInclusive(), size);

It seems it could be resolved by using %s instead of %d perhaps?

Activity

  1. product-auto-label
    added
    api: storageIssues related to the googleapis/java-storage API.
    on Mar 5, 2025
  2. nicktindall
    changed the title [-]Storage: Range header is formatted with default locale[/-] [+]Storage: Content-Range header is formatted with default locale[/+] on Mar 5, 2025
  3. BenWhitehead
    added 2 commits that reference this issue on Mar 5, 2025

    fix: update usages of String.format to explicitly pass Locale.US

    This issue will close once commit 6835471 is merged into the 'main' branch.
    6835471

    fix: update usages of String.format to explicitly pass Locale.US

    This issue will close once commit 79da949 is merged into the 'main' branch.
    79da949
  4. BenWhitehead
    added
    priority: p2Moderately-important priority. Fix may not be included in next release.
    type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.
    on Mar 5, 2025
  5. BenWhitehead
    closed this as completedin #2974on Mar 5, 2025
  6. BenWhitehead
    closed this as completedin 8bcb2deon Mar 5, 2025
  7. renovate-bot
    added a commit that references this issue on Mar 5, 2025

    fix: update usages of String.format to explicitly pass Locale.US (goo…

    This issue will close once commit 8bcb2de is merged into the 'main' branch.
    8bcb2de
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    api: storageIssues related to the googleapis/java-storage API.priority: p2Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402775 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.