notepad-plus-plus / notepad-plus-plus/notepad-plus-plus

Function parameters hints written in Japanese get garbled

Open
#4,309 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
29.4k
Forks
5.4k
PR merge metrics
No merged PRs in 30d

Description

Description of the Issue

When I create/modify an API file (plugins\APIs\) with my function hints in Japanese, it provides gabled ones.
I specified encodings as UTF-8 and Shift_JIS because the default Windows-1252 cannot contain Japanese letters, but both are garbled.
(...I feel this will occur also in some non-latin languages, but I didn't confirmed)

Steps to Reproduce the Issue (UTF-8)
  1. Open Notepad++, create a new file and set its encoding as Encoding -> UTF-8
  2. Specify its encoding at the first line as <?xml version="1.0" encoding="UTF-8" ?>
  3. Complete my Lua API hints in Japanese like this
<?xml version="1.0" encoding="UTF-8" ?>
<NotepadPlus>
	<Environment ignoreCase="yes" startFunc="(" stopFunc=")" paramSeparator="," terminal=";" additionalWordChar=".:" />
	<AutoComplete language="LUA">
		<KeyWord name="somefunc" func="yes">
			<Overload retVal="返り値" descr="日本語ヒント">
				<Param name="引数1" />
				<Param name="引数2" />
			</Overload>
		</KeyWord>
	</AutoComplete>
</NotepadPlus>
  1. Save it somewhere
  2. Close Notepad++
  3. Copy it to C:\Program Files (x86)\Notepad++\plugins\APIs and rename as lua.xml
  4. Open Notepad++, create a new file and set its language as Lua
  5. Confirm Function parameters hint on input is enabled in the preference.
  6. Type somefunc() (note that function completion works correctly if enabled)
Steps to Reproduce the Issue (Shift_JIS)
  1. Open Notepad++, create a new file and set its encoding as Encoding -> Character sets -> Japanese -> Shift-JIS
  2. Specify its encoding at the first line as <?xml version="1.0" encoding="Shift_JIS" ?>
  3. Complete my Lua API hints in Japanese like this
<?xml version="1.0" encoding="Shift_JIS" ?>
<NotepadPlus>
...

...The rest is the same as UTF-8.

Expected Behavior

somefunc expected
collage.

Actual Behavior

UTF-8
somefunc utf-8

Shift_JIS
somefunc shift_jis

(Extra: Windows-1252 with English contents)
somefunc windows-1252

Debug Information

Notepad++ v7.5.4 (32-bit)
Build time : Jan 1 2018 - 01:47:45
Path : C:\Program Files (x86)\Notepad++\notepad++.exe
Admin mode : OFF
Local Conf mode : OFF
OS : Windows 7 (64-bit)
Plugins : ComparePlugin.dll DSpellCheck.dll mimeTools.dll NppConverter.dll NppExport.dll NppFTP.dll NppTextFX.dll NppToolBucket.dll PluginManager.dll Translate.dll zoomdisabler.dll

Global styles -> Grobal override
Font name: Migu 1M
Enable global font: ON

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the API files under plugins\APIs\ and the Lua function-parameter hint path enabled in Preferences; compare how UTF-8 and Shift_JIS declarations are read and displayed. Reproduce the supplied Japanese example, then verify that function hints show the original Japanese text correctly for both encodings without breaking completion.

Written by the indexing model from the issue text.

Assessment

Tech stack
lua
Domain
desktop, internationalization
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.