Skip to content

Instantly share code, notes, and snippets.

@craigstjean
craigstjean / javasoft.reg
Last active August 21, 2025 11:56
Configure OpenJDK in Windows Registry
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft]
[HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment]
"CurrentVersion"="1.8"
[HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment\1.8]
"JavaHome"="C:\\Tools\\Java\\jdk8u192-b12\\jre"
"RuntimeLib"="C:\\Tools\\Java\\jdk8u192-b12\\jre\\bin\\j9vm\\jvm.dll"
@BarelyAliveMau5
BarelyAliveMau5 / modified_utf8.py
Last active November 15, 2024 07:58
python's version of java's modified utf8
# translated from: http://hg.openjdk.java.net/jdk8/jdk8/jdk/file/94cc251d0c45/src/share/npt/utf.c
def utf8s_to_utf8m(string):
"""
:param string: utf8 encoded string
:return: modified utf8 encoded string
"""
new_str = []
i = 0
while i < len(string):