Comments (4)
SourceKit offsets are in bytes. Python len()
etc. work on unicode characters. See eg. #635.
from sourcekitten.
The result printed in the second part of the Question is only the end, not the whole
from sourcekitten.
@johnfairh Thanks :) this is my python code to resolve.
if __name__ == "__main__":
content = ''
with open(file_path, 'r') as file:
content = file.read()
byte_length = len(content.encode('utf-8'))
# print(byte_length)
# parse(file_path=file_path)
byte_string = content.encode('utf-8')
offset = 583 // replace your bodyoffset
offset_byte_string = byte_string[0:offset]
offset_string = offset_byte_string.decode('utf-8')
print(offset_string)
from sourcekitten.
Closing since the initial question was answered
from sourcekitten.
Related Issues (20)
- illegal hardware instruction HOT 3
- Sourcekitten 'complete' resulting in Loading standard library failed. HOT 3
- SourceKit asynchronous requests HOT 2
- Code Blocks for case statements not reported in Structure HOT 2
- `File.contents` will crash for files that cannot be read later, when initialised with `init(pathDeferringReading:)`
- make: *** [install] Error 71 HOT 1
- Request.syntaxTree not found "key.serialized_syntax_tree" in Apple Silicon M2 Xcode14.3 HOT 1
- Crash when running sourcekitten HOT 3
- Error: No such module 'SWXMLHash' HOT 3
- Add argument to specify output directory for `swift` or `xcodebuild` logs
- How to specify external SPM dependencies? HOT 1
- SPM build manifest does not exist… or does not match expected format HOT 14
- Illegal instructions 4 when parsing enum HOT 1
- Linux: SourceKittenFramework/library_wrapper.swift:31: Fatal error: Loading libsourcekitdInProc.so failed HOT 1
- Failure to build with Xcode 15 HOT 1
- Errors Building on main branch HOT 1
- sourcekitten complete on Linux not doing what I expected HOT 1
- Xcode 15.3 warning "capture of 'handle' with non-sendable type 'UnsafeMutablePointer<sourcekitd_request_handle_t?>'"
- Building an exhaustive list of a class dependencies: missing some information ? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sourcekitten.