Text.current_character wrong value for certain characters #65843
Labels
No Label
Interest
Animation & Rigging
Interest
Blender Cloud
Interest
Collada
Interest
Core
Interest
Documentation
Interest
Eevee & Viewport
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
Import and Export
Interest
Modeling
Interest
Modifiers
Interest
Nodes & Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds, Tests & Devices
Interest
Python API
Interest
Rendering & Cycles
Interest
Sculpt, Paint & Texture
Interest
Translations
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Meta
Good First Issue
Meta
Papercut
Module
Add-ons (BF-Blender)
Module
Add-ons (Community)
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender-addons#65843
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
System Information
Operating system: Windows-10-10.0.17763 64 Bits
Graphics card: GeForce GTX 1080/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 419.17
Blender Version
Broken: version: 2.80 (sub 74), branch: blender2.7, commit date: 2019-06-14 23:24, hash:
blender/blender@0fd96b4128
Worked: Never. 2.79 has the same issue.
Short description of error
Property
current_character
andselect_end_character
onbpy.types.Text
objects both report wrong values for some unicode characters. Some characters have a size of 2 and some have 3.Exact steps for others to reproduce the error
[Based on the default startup or an attached .blend file (as simple as possible)]
text_current_character.blend
Added subscriber: @KaiJaegersen
Added subscriber: @lichtwerk
Can confirm.
current_character
andselect_end_character
are directly pointing to text DNAcurc
,selc
(and these can indeed inherit the "error" of unicode characters having a differrent length that one...)Guess this could be resolved by making a rna property func that takes these into account using
txt_utf8_offset_to_index
orBLI_str_utf8_size
...Can check [might take a bit though...]
The characters are unusual to come across so this isn't exactly a pressing issue, but thanks for looking into it!
Having it report correct caret position would be helpful for extending the functionality of the text editor using python.
Added subscriber: @ideasman42
Changed status from 'Open' to: 'Resolved'
Fixed blender/blender@8096190d11