utf16 file detected as binary file
Bug #267296 reported by
JoeDevSys
This bug affects 5 people
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Bazaar |
Confirmed
|
Medium
|
Unassigned | ||
Breezy |
Triaged
|
Medium
|
Unassigned |
Bug Description
bzr 1.5 on windows
Create new text file in notepad, save file with encoding="unicode" in SaveAs dialog. (First two bytes of file are 0xff 0xfe)
Commit.
Edit file with new text.
bzr diff treats the file as binary and does not report text differences.
Interestingly "UTF8" files are treated correctly.
Related branches
lp://staging/~garyvdm/bzr/unicode_bom_detect
- Martin Packman (community): Needs Information
- bzr-core: Pending requested
-
Diff: 229 lines (+91/-17)7 files modifiedNEWS (+7/-0)
bzrlib/diff.py (+2/-2)
bzrlib/merge.py (+1/-1)
bzrlib/merge3.py (+4/-4)
bzrlib/shelf_ui.py (+2/-2)
bzrlib/tests/test_textfile.py (+27/-6)
bzrlib/textfile.py (+48/-2)
summary: |
- unicode file treated as binary file + utf16 file detected as binary file |
Changed in bzr: | |
assignee: | nobody → Gary van der Merwe (garyvdm) |
status: | Triaged → In Progress |
Changed in bzr: | |
assignee: | canonical-bazaar (canonical-bazaar) → nobody |
tags: | added: patch-needswork |
tags: | added: check-for-breezy |
tags: | removed: check-for-breezy |
Changed in brz: | |
status: | New → Triaged |
importance: | Undecided → Medium |
To post a comment you must log in.
Sounds like your file is saved as UTF-16 LE, which is looks just like a binary file to almost any tool, not just Bazaar.
Saving your files as UTF-8 is almost always the right thing to do, as it is the only Unicode encoding fully supported by almost every tool.