René's URL Explorer Experiment


Title: Line breakpoints never verify in UTF-16 encoded source files · Issue #1726 · microsoft/vscode-java-debug · GitHub

Open Graph Title: Line breakpoints never verify in UTF-16 encoded source files · Issue #1726 · microsoft/vscode-java-debug

X Title: Line breakpoints never verify in UTF-16 encoded source files · Issue #1726 · microsoft/vscode-java-debug

Description: Line breakpoints in Java source files encoded as UTF-16 LE with BOM stay unverified forever, even after the class is loaded and the line contains code. The same files debug fine in Eclipse. Our sources are UTF-16 because the ERP developm...

Open Graph Description: Line breakpoints in Java source files encoded as UTF-16 LE with BOM stay unverified forever, even after the class is loaded and the line contains code. The same files debug fine in Eclipse. Our sou...

X Description: Line breakpoints in Java source files encoded as UTF-16 LE with BOM stay unverified forever, even after the class is loaded and the line contains code. The same files debug fine in Eclipse. Our sou...

Opengraph URL: https://github.com/microsoft/vscode-java-debug/issues/1726

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Line breakpoints never verify in UTF-16 encoded source files","articleBody":"Line breakpoints in Java source files encoded as **UTF-16 LE with BOM** stay unverified forever, even after the class is loaded and the line contains code. The same files debug fine in Eclipse. Our sources are UTF-16 because the ERP development environment we work with generates them that way, so we cannot switch to UTF-8.\n\n##### Environment\n- Operating System: Windows Server 2022\n- JDK version: JRE 25 embedded in the Java extension (language server); debuggee runs on JDK 11\n- Visual Studio Code version: 1.144.0\n- Java extension version: 1.58.0\n- Java Debugger extension version: 0.60.2026102705 (pre-release, bundles com.microsoft.java.debug.plugin 0.53.2)\n\n##### Steps To Reproduce\n1. Create `demo/A.java` as UTF-16 LE with BOM, for example in PowerShell:\n   ```powershell\n   New-Item -ItemType Directory -Force demo | Out-Null\n   [IO.File]::WriteAllText(\"$PWD\\demo\\A.java\", \"package demo;`r`n`r`npublic class A {`r`n    public static void main(String[] a) {`r`n        int x = 1;`r`n        System.out.println(x);`r`n    }`r`n}`r`n\", [Text.UnicodeEncoding]::new($false, $true))\n   ```\n   Content of the file:\n   ```java\n   package demo;\n\n   public class A {\n       public static void main(String[] a) {\n           int x = 1;\n           System.out.println(x);\n       }\n   }\n   ```\n2. Open the folder in VS Code and set a line breakpoint on `int x = 1;`\n3. Debug `demo.A`\n\n##### Current Result\nThe breakpoint stays grey (\"unverified\") and the program runs through without stopping. We see this for every line breakpoint in every UTF-16 file of our real project.\n\n##### Expected Result\nThe breakpoint is verified and execution stops, as it does for UTF-8 files.\n\n##### Additional Informations\nI think the cause is in microsoft/java-debug, `JdtSourceLookUpProvider.readFile`: it reads the file with `new InputStreamReader(new FileInputStream(filePath))`, i.e. with the JVM default charset (UTF-8). For a UTF-16 file the `ASTParser` then finds no package and no type, so no class name is resolved and the breakpoint can never be bound. Calling `readFile` from the shipped plugin jar (0.53.2) on the file above and parsing the result the same way gives no package and no type; with the BOM-aware version below it gives `package demo`, type `A`.\n\nWorkaround I tried: `-Dfile.encoding=UTF-16` in `java.jdt.ls.vmargs` fixes the parsing, but then the language server does not start (`ExceptionInInitializerError` in `org.eclipse.core.net`, caused by `NullPointerException: key can't be null` while loading a native library).\n\nA small change that honours the BOM fixed it for me (tested locally by rebuilding the plugin jar: breakpoints in UTF-16 files verify and stop, UTF-8 files with and without BOM behave as before):\n\n```java\nprivate static String readFile(String filePath) {\n    try {\n        byte[] bytes = Files.readAllBytes(Paths.get(filePath));\n        if (bytes.length >= 3 && (bytes[0] & 0xFF) == 0xEF && (bytes[1] & 0xFF) == 0xBB && (bytes[2] & 0xFF) == 0xBF) {\n            return new String(bytes, 3, bytes.length - 3, StandardCharsets.UTF_8);\n        }\n        if (bytes.length >= 2 && (bytes[0] & 0xFF) == 0xFF && (bytes[1] & 0xFF) == 0xFE) {\n            return new String(bytes, 2, bytes.length - 2, StandardCharsets.UTF_16LE);\n        }\n        if (bytes.length >= 2 && (bytes[0] & 0xFF) == 0xFE && (bytes[1] & 0xFF) == 0xFF) {\n            return new String(bytes, 2, bytes.length - 2, StandardCharsets.UTF_16BE);\n        }\n        return new String(bytes, Charset.defaultCharset());\n    } catch (IOException e) {\n        return \"\";\n    }\n}\n```\n\nUsing the resource charset (`IFile.getCharset()`) where the file belongs to a workspace project might be even better. I'm happy to open a PR in microsoft/java-debug if that helps.\n","author":{"url":"https://github.com/barbarabrugger","@type":"Person","name":"barbarabrugger"},"datePublished":"2026-10-28T21:58:21Z","url":"https://github.com/microsoft/vscode-java-debug/issues/1726"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:6e85727a-41d3-19c2-fc20-a3c8e49dbdb5
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id884E:23D581:EE349:147ABB:6AF7CF09
html-safe-nonce5d97ecb1da25e9e3165af1baaa3ba8c1302ea34c0477447d3705fff0ae62a0fa
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4ODRFOjIzRDU4MTpFRTM0OToxNDdBQkI6NkFGN0NGMDkiLCJ2aXNpdG9yX2lkIjoiNTkzNDk1MzUwMzA4MjI4ODczIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac228f7e1bfa3dc8c1b92b968e750de059748e82a88c09399726dfdcd426eb88bc
hovercard-subject-tagissue:6088244032
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/microsoft/vscode-java-debug/1726/issue_layout
twitter:imagehttps://opengraph.githubassets.com/8128166d5a3d1b944a95941be816743c28430e32d428965724f17428fabae56d/microsoft/vscode-java-debug/issues/1726
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/8128166d5a3d1b944a95941be816743c28430e32d428965724f17428fabae56d/microsoft/vscode-java-debug/issues/1726
og:image:altLine breakpoints in Java source files encoded as UTF-16 LE with BOM stay unverified forever, even after the class is loaded and the line contains code. The same files debug fine in Eclipse. Our sou...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamebarbarabrugger
hostnamegithub.com
expected-hostnamegithub.com
None0538a59d4a0acd1aee7d41f7f56bd94b5294b4b7cb8ac3a11a32ac8bb4562076
turbo-cache-controlno-preview
go-importgithub.com/microsoft/vscode-java-debug git https://github.com/microsoft/vscode-java-debug.git
octolytics-dimension-user_id6154722
octolytics-dimension-user_loginmicrosoft
octolytics-dimension-repository_id102584737
octolytics-dimension-repository_nwomicrosoft/vscode-java-debug
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id102584737
octolytics-dimension-repository_network_root_nwomicrosoft/vscode-java-debug
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release8a34a01748011ac03e602fdd18a9597dd6341074
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/microsoft/vscode-java-debug/issues/1726#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmicrosoft%2Fvscode-java-debug%2Fissues%2F1726
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmicrosoft%2Fvscode-java-debug%2Fissues%2F1726
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=microsoft%2Fvscode-java-debug
Reloadhttps://github.com/microsoft/vscode-java-debug/issues/1726
Reloadhttps://github.com/microsoft/vscode-java-debug/issues/1726
Reloadhttps://github.com/microsoft/vscode-java-debug/issues/1726
microsofthttps://github.com/microsoft
vscode-java-debughttps://github.com/microsoft/vscode-java-debug
Codehttps://github.com/microsoft/vscode-java-debug
Issues201 (201)https://github.com/microsoft/vscode-java-debug/issues
Pull requests7 (7)https://github.com/microsoft/vscode-java-debug/pulls
Discussionshttps://github.com/microsoft/vscode-java-debug/discussions
Actionshttps://github.com/microsoft/vscode-java-debug/actions
Wikihttps://github.com/microsoft/vscode-java-debug/wiki
Security and qualityhttps://github.com/microsoft/vscode-java-debug/security
Insightshttps://github.com/microsoft/vscode-java-debug/pulse
https://github.com/microsoft/vscode-java-debug
New issuehttps://github.com/login?return_to=https://github.com/microsoft/vscode-java-debug/issues/1726
New issuehttps://github.com/login?return_to=https://github.com/microsoft/vscode-java-debug/issues/1726
microsoft/java-debug#647https://github.com/microsoft/java-debug/pull/647
Line breakpoints never verify in UTF-16 encoded source fileshttps://github.com/microsoft/vscode-java-debug/issues/1726#top
microsoft/java-debug#647https://github.com/microsoft/java-debug/pull/647
https://github.com/chagong
bughttps://github.com/microsoft/vscode-java-debug/issues?q=state%3Aopen%20label%3A%22bug%22
component.debuggerhttps://github.com/microsoft/vscode-java-debug/issues?q=state%3Aopen%20label%3A%22component.debugger%22
component.java-debug-serverhttps://github.com/microsoft/vscode-java-debug/issues?q=state%3Aopen%20label%3A%22component.java-debug-server%22
priority.highhttps://github.com/microsoft/vscode-java-debug/issues?q=state%3Aopen%20label%3A%22priority.high%22
https://github.com/barbarabrugger
Barbara Brugger (barbarabrugger)https://github.com/barbarabrugger
on Oct 28, 2026https://github.com/microsoft/vscode-java-debug/issues/1726#issue-6088244032
issuelenshttps://github.com/apps/issuelens
bughttps://github.com/microsoft/vscode-java-debug/issues?q=state%3Aopen%20label%3A%22bug%22
priority.highhttps://github.com/microsoft/vscode-java-debug/issues?q=state%3Aopen%20label%3A%22priority.high%22
component.debuggerhttps://github.com/microsoft/vscode-java-debug/issues?q=state%3Aopen%20label%3A%22component.debugger%22
component.java-debug-serverhttps://github.com/microsoft/vscode-java-debug/issues?q=state%3Aopen%20label%3A%22component.java-debug-server%22
on Oct 28, 2026https://github.com/microsoft/vscode-java-debug/issues/1726#event-34524827561
issuelenshttps://github.com/apps/issuelens
Changyong Gong (chagong)https://github.com/chagong
on Oct 28, 2026https://github.com/microsoft/vscode-java-debug/issues/1726#event-34524914076
https://github.com/apps/issuelens
issuelenshttps://github.com/apps/issuelens
on Oct 28, 2026https://github.com/microsoft/vscode-java-debug/issues/1726#issuecomment-6481816958
IssueLenshttps://github.com/microsoft/IssueLens
Changyong Gong (chagong)https://github.com/chagong
completedhttps://github.com/microsoft/vscode-java-debug/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
java-debug#647https://github.com/microsoft/java-debug/pull/647
on Oct 29, 2026https://github.com/microsoft/vscode-java-debug/issues/1726#event-34542980536
Sign up for freehttps://github.com/signup?return_to=https://github.com/microsoft/vscode-java-debug/issues/1726
Sign in to commenthttps://github.com/login?return_to=https://github.com/microsoft/vscode-java-debug/issues/1726
Changyong Gong (chagong)https://github.com/chagong
bughttps://github.com/microsoft/vscode-java-debug/issues?q=state%3Aopen%20label%3A%22bug%22
component.debuggerhttps://github.com/microsoft/vscode-java-debug/issues?q=state%3Aopen%20label%3A%22component.debugger%22
component.java-debug-serverhttps://github.com/microsoft/vscode-java-debug/issues?q=state%3Aopen%20label%3A%22component.java-debug-server%22
priority.highhttps://github.com/microsoft/vscode-java-debug/issues?q=state%3Aopen%20label%3A%22priority.high%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.